mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Merge pull request #44209 from irfanurrehman/kubefed-3
Automatic merge from submit-queue (batch tested with PRs 44286, 44209) [Federation][Kubefed] Bug fix to enable disabling federation controllers through override args Targets https://github.com/kubernetes/kubernetes/issues/42761 **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # https://github.com/kubernetes/kubernetes/issues/42761 **Special notes for your reviewer**: @marun @perotinus @nikhiljindal **Release note**: ``` NONE ```
This commit is contained in:
commit
2976cb82ce
@ -912,7 +912,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)
|
||||
}
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user