E2E - Dont set --master-count if --control-plane-count is in --create-args

Previously we were only not setting --master-count if --master-count was in --create-args.
Now we recognize either flag. This fixes E2E jobs that specify --control-plane-count and kops create cluster ends up having both flags
This commit is contained in:
Peter Rifel 2023-08-06 08:57:03 -05:00
parent c107cfdf90
commit 36940bf665
No known key found for this signature in database
GPG Key ID: BC6469E5B16DB2B6
1 changed files with 15 additions and 1 deletions

View File

@ -134,7 +134,21 @@ func (d *deployer) createCluster(zones []string, adminAccess string, yes bool) e
args = append(args, createArgs...)
}
args = appendIfUnset(args, "--admin-access", adminAccess)
args = appendIfUnset(args, "--master-count", fmt.Sprintf("%d", d.ControlPlaneCount))
// Dont set --master-count if either --control-plane-count or --master-count
// has been provided in --create-args
foundCPCount := false
for _, existingArg := range args {
existingKey := strings.Split(existingArg, "=")
if existingKey[0] == "--control-plane-count" || existingKey[0] == "--master-count" {
foundCPCount = true
break
}
}
if !foundCPCount {
args = appendIfUnset(args, "--master-count", fmt.Sprintf("%d", d.ControlPlaneCount))
}
args = appendIfUnset(args, "--master-volume-size", "48")
args = appendIfUnset(args, "--node-count", "4")
args = appendIfUnset(args, "--node-volume-size", "48")