summaryrefslogtreecommitdiff
path: root/edge
diff options
context:
space:
mode:
authorZhizhen He <hezhizhen.yi@gmail.com>2023-03-23 22:04:34 +0800
committerZhizhen He <hezhizhen.yi@gmail.com>2023-08-25 20:42:43 +0800
commit10e5aeb1ba420da20c9d467e300205eed07055b9 (patch)
tree46b0d1373c85184a55f5e695ac55c020f92b3973 /edge
parentMerge pull request #4939 from wlq1212/e2e/compatibility (diff)
downloadkubeedge-10e5aeb1ba420da20c9d467e300205eed07055b9.tar.gz
fix typo and update comments
Signed-off-by: Zhizhen He <hezhizhen.yi@gmail.com>
Diffstat (limited to 'edge')
-rw-r--r--edge/pkg/common/modules/group.go2
-rw-r--r--edge/pkg/common/util/config.go14
-rw-r--r--edge/pkg/devicetwin/dttype/types_helper.go2
-rwxr-xr-xedge/test/integration/utils/edge/testcontext.go4
-rw-r--r--edge/test/integration/utils/helpers/helpers.go2
-rw-r--r--edge/test/test.go4
6 files changed, 13 insertions, 15 deletions
diff --git a/edge/pkg/common/modules/group.go b/edge/pkg/common/modules/group.go
index 2f43ae94b..f785d57e8 100644
--- a/edge/pkg/common/modules/group.go
+++ b/edge/pkg/common/modules/group.go
@@ -9,7 +9,7 @@ const (
TwinGroup = "twin"
// MetaGroup group
MetaGroup = "meta"
- //EdgedGroup group
+ // EdgedGroup group
EdgedGroup = "edged"
// UserGroup is ServiceBus group
UserGroup = "user"
diff --git a/edge/pkg/common/util/config.go b/edge/pkg/common/util/config.go
index 0c08d54f9..123e3bf50 100644
--- a/edge/pkg/common/util/config.go
+++ b/edge/pkg/common/util/config.go
@@ -76,15 +76,13 @@ func GenerateTestCertificate(path string, certFileName string, keyFileName strin
}
keyFilePEM := pem.Block{
Type: "RSA PRIVATE KEY",
- Bytes: pKey}
- err = createPEMfile(path+keyFileName+".key", keyFilePEM)
- if err != nil {
- return err
+ Bytes: pKey,
}
- return nil
+
+ return createPEMfile(path+keyFileName+".key", keyFilePEM)
}
-// createPEMfile() creates an encoded file at the path given, with PEM Block specified
+// createPEMfile creates an encoded file at the path given, with PEM Block specified
func createPEMfile(path string, pemBlock pem.Block) error {
// this will create plain text PEM file.
file, err := os.Create(path)
@@ -98,6 +96,6 @@ func createPEMfile(path string, pemBlock pem.Block) error {
klog.Errorf("failed to close file, path: %v, error: %v", path, err)
}
}()
- err = pem.Encode(file, &pemBlock)
- return err
+
+ return pem.Encode(file, &pemBlock)
}
diff --git a/edge/pkg/devicetwin/dttype/types_helper.go b/edge/pkg/devicetwin/dttype/types_helper.go
index dd3357972..b6b37c582 100644
--- a/edge/pkg/devicetwin/dttype/types_helper.go
+++ b/edge/pkg/devicetwin/dttype/types_helper.go
@@ -193,7 +193,7 @@ type MembershipGetResult struct {
Devices []Device `json:"devices"`
}
-// BuildMembershipGetResult build memebership
+// BuildMembershipGetResult build membership
func BuildMembershipGetResult(baseMessage BaseMessage, devices []*Device) ([]byte, error) {
result := make([]Device, 0, len(devices))
for _, v := range devices {
diff --git a/edge/test/integration/utils/edge/testcontext.go b/edge/test/integration/utils/edge/testcontext.go
index 2c62b3c07..9c46d4813 100755
--- a/edge/test/integration/utils/edge/testcontext.go
+++ b/edge/test/integration/utils/edge/testcontext.go
@@ -16,12 +16,12 @@ limitations under the License.
package edge
-// Test context struct
+// TestContext is test context struct
type TestContext struct {
Cfg Config
}
-// function to get the testcontext Object.
+// NewTestContext gets the TestContext Object.
func NewTestContext(cfg Config) *TestContext {
return &TestContext{
Cfg: cfg,
diff --git a/edge/test/integration/utils/helpers/helpers.go b/edge/test/integration/utils/helpers/helpers.go
index 059963025..48ec24181 100644
--- a/edge/test/integration/utils/helpers/helpers.go
+++ b/edge/test/integration/utils/helpers/helpers.go
@@ -208,7 +208,7 @@ func GetDeviceAttributesFromDB(deviceID string, Name string) Attribute {
return attribute
}
-// HubclientInit create mqtt client config
+// HubClientInit create mqtt client config
func HubClientInit(server, clientID, username, password string) *MQTT.ClientOptions {
opts := MQTT.NewClientOptions().AddBroker(server).SetClientID(clientID).SetCleanSession(true)
if username != "" {
diff --git a/edge/test/test.go b/edge/test/test.go
index 047403b79..2e69169ab 100644
--- a/edge/test/test.go
+++ b/edge/test/test.go
@@ -39,7 +39,7 @@ func (tm *testManager) Name() string {
}
func (tm *testManager) Group() string {
- //return core.MetaGroup
+ // return core.MetaGroup
return modules.MetaGroup
}
@@ -87,7 +87,7 @@ func GetPodListFromEdged(w http.ResponseWriter) error {
return nil
}
-// Function to handle Get/Add/Delete deployment list.
+// podHandler handles Get/Add/Delete deployment list.
func (tm *testManager) podHandler(w http.ResponseWriter, req *http.Request) {
var operation string
var p v1.Pod