mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 13:31:52 +00:00
[Federation][Kubefed] Bug fix to enable disabling federation controllers through override args
This commit is contained in:
parent
4957a232b1
commit
fe87957818
@ -912,7 +912,7 @@ func marshallOverrides(overrideArgString string) (map[string]string, error) {
|
|||||||
argsMap := make(map[string]string)
|
argsMap := make(map[string]string)
|
||||||
overrideArgs := strings.Split(overrideArgString, ",")
|
overrideArgs := strings.Split(overrideArgString, ",")
|
||||||
for _, overrideArg := range overrideArgs {
|
for _, overrideArg := range overrideArgs {
|
||||||
splitArg := strings.Split(overrideArg, "=")
|
splitArg := strings.SplitN(overrideArg, "=", 2)
|
||||||
if len(splitArg) != 2 {
|
if len(splitArg) != 2 {
|
||||||
return nil, fmt.Errorf("wrong format for override arg: %s", overrideArg)
|
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",
|
expectedErr: "wrong format for override arg: wrong-format-arg",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
overrideParams: "wrong-format-arg=override=wrong-format-arg=override",
|
// TODO: Multiple arg values separated by , are not supported yet
|
||||||
expectedErr: "wrong format for override arg: wrong-format-arg=override=wrong-format-arg=override",
|
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",
|
overrideParams: "=wrong-format-only-value",
|
||||||
|
Loading…
Reference in New Issue
Block a user