Skip to content

Commit

Permalink
Merge pull request kubeedge#5128 from testwill/typo
Browse files Browse the repository at this point in the history
fix: typo
  • Loading branch information
kubeedge-bot authored Nov 3, 2023
2 parents 1fd5531 + 10af84b commit 36e0e06
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion common/constants/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ const (
EdgeNodeRoleKey = "node-role.kubernetes.io/edge"
EdgeNodeRoleValue = ""

DeafultMosquittoContainerName = "mqtt-kubeedge"
DefaultMosquittoContainerName = "mqtt-kubeedge"
DeployMqttContainerEnv = "DEPLOY_MQTT_CONTAINER"

// DefaultManifestsDir edge node default static pod path
Expand Down
4 changes: 2 additions & 2 deletions edge/pkg/metamanager/client/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (c *pods) Get(name string) (*corev1.Pod, error) {

func (c *pods) Patch(name string, patchBytes []byte) (*corev1.Pod, error) {
resource := fmt.Sprintf("%s/%s/%s", c.namespace, model.ResourceTypePodPatch, name)
if name == constants.DeafultMosquittoContainerName {
if name == constants.DefaultMosquittoContainerName {
return handleMqttMeta()
}
podMsg := message.BuildMsg(modules.MetaGroup, "", modules.EdgedModuleName, resource, model.PatchOperation, string(patchBytes))
Expand Down Expand Up @@ -191,7 +191,7 @@ func updatePodDB(resource string, pod *corev1.Pod) error {

func handleMqttMeta() (*corev1.Pod, error) {
var pod corev1.Pod
metas, err := dao.QueryMeta("key", fmt.Sprintf("default/pod/%s", constants.DeafultMosquittoContainerName))
metas, err := dao.QueryMeta("key", fmt.Sprintf("default/pod/%s", constants.DefaultMosquittoContainerName))
if err != nil || len(*metas) != 1 {
return nil, fmt.Errorf("get mqtt meta failed, err: %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions edge/pkg/metamanager/dao/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func SaveMQTTMeta(nodeName string) error {
APIVersion: "v1",
},
ObjectMeta: metaV1.ObjectMeta{
Name: constants.DeafultMosquittoContainerName,
Name: constants.DefaultMosquittoContainerName,
Namespace: "default",
UID: uuid.NewUUID(),
},
Expand Down Expand Up @@ -174,7 +174,7 @@ func SaveMQTTMeta(nodeName string) error {
}
mqttDataStr, _ := json.Marshal(mqttData)
mqttMeta := Meta{
Key: fmt.Sprintf("default/pod/%s", constants.DeafultMosquittoContainerName),
Key: fmt.Sprintf("default/pod/%s", constants.DefaultMosquittoContainerName),
Type: "pod",
Value: string(mqttDataStr),
}
Expand Down

0 comments on commit 36e0e06

Please sign in to comment.