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

kubetest2 - don't overwrite create args that use equals signs #10994

Merged
merged 1 commit into from
Mar 8, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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