Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Federation][Kubefed] Bug fix to enable disabling federation controllers through override args #44341

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion federation/pkg/kubefed/init/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ func marshallOverrides(overrideArgString string) (map[string]string, error) {
argsMap := make(map[string]string)
overrideArgs := strings.Split(overrideArgString, ",")
for _, overrideArg := range overrideArgs {
splitArg := strings.Split(overrideArg, "=")
splitArg := strings.SplitN(overrideArg, "=", 2)
if len(splitArg) != 2 {
return nil, fmt.Errorf("wrong format for override arg: %s", overrideArg)
}
Expand Down
6 changes: 4 additions & 2 deletions federation/pkg/kubefed/init/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,10 @@ func TestMarshallAndMergeOverrides(t *testing.T) {
expectedErr: "wrong format for override arg: wrong-format-arg",
},
{
overrideParams: "wrong-format-arg=override=wrong-format-arg=override",
expectedErr: "wrong format for override arg: wrong-format-arg=override=wrong-format-arg=override",
// TODO: Multiple arg values separated by , are not supported yet
overrideParams: "multiple-equalto-char=first-key=1",
expectedSet: sets.NewString("arg2=val2", "arg1=val1", "multiple-equalto-char=first-key=1"),
expectedErr: "",
},
{
overrideParams: "=wrong-format-only-value",
Expand Down