Skip to content

Commit

Permalink
Merge pull request #10994 from rifelpet/kubetest2-equals
Browse files Browse the repository at this point in the history
kubetest2 - don't overwrite create args that use equals signs
  • Loading branch information
k8s-ci-robot authored Mar 8, 2021
2 parents fea7589 + 594cdc6 commit 6ce35f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/e2e/kubetest2-kops/deployer/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ func (d *deployer) zones() ([]string, error) {
// This shouldn't be used for arguments that can be specified multiple times like --override
func appendIfUnset(args []string, arg, value string) []string {
for _, existingArg := range args {
if existingArg == arg {
existingKey := strings.Split(existingArg, "=")
if existingKey[0] == arg {
return args
}
}
Expand Down
7 changes: 7 additions & 0 deletions tests/e2e/kubetest2-kops/deployer/up_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ func TestAppendIfUnset(t *testing.T) {
"bar",
[]string{"--foo", "bar"},
},
{
"set with same value and equals sign",
[]string{"--foo=bar", "--baz=bar"},
"--foo",
"bar",
[]string{"--foo=bar", "--baz=bar"},
},
}

for _, tc := range cases {
Expand Down

0 comments on commit 6ce35f9

Please sign in to comment.