Skip to content

Commit

Permalink
fix: wrong inject registercenter version key (#6471)
Browse files Browse the repository at this point in the history
* fix: wrong inject registercenter version key

* feat: single test
  • Loading branch information
CeerDecy authored Nov 28, 2024
1 parent 12c9840 commit 0a48220
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/tools/orchestrator/services/addon/addon.go
Original file line number Diff line number Diff line change
Expand Up @@ -3911,7 +3911,7 @@ func (a *Addon) injectVersion(addon *apistructs.AddonCreateItem) error {
if addon.Options == nil {
addon.Options = make(map[string]string)
}
if v, ok := addon.Options["Version"]; ok && v != "" {
if v, ok := addon.Options["version"]; ok && v != "" {
return nil
}

Expand All @@ -3928,6 +3928,6 @@ func (a *Addon) injectVersion(addon *apistructs.AddonCreateItem) error {
return fmt.Errorf("there are no default addons [%s]", addon.Type)
}

addon.Options["Version"] = defaultAddon.Version
addon.Options["version"] = defaultAddon.Version
return nil
}
2 changes: 1 addition & 1 deletion internal/tools/orchestrator/services/addon/addon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1584,7 +1584,7 @@ func TestInjectVersion(t *testing.T) {
Name: "register-center",
Type: "registercenter",
Options: map[string]string{
"Version": "2.0.0",
"version": "2.0.0",
},
},
}
Expand Down

0 comments on commit 0a48220

Please sign in to comment.