Merge pull request #10658 from rifelpet/kubetest-upgrade

Add --create-args kubetest2 flag
This commit is contained in:
Kubernetes Prow Robot 2021-01-25 21:42:34 -08:00 committed by GitHub
commit 9bec1e472e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View File

@ -138,7 +138,14 @@ func (d *deployer) featureFlags() string {
"+SpecOverrideFlag",
"+AlphaAllowGCE",
}
return strings.Join(ff, ",")
val := strings.Join(ff, ",")
for _, env := range d.Env {
e := strings.Split(env, "=")
if e[0] == "KOPS_FEATURE_FLAGS" && len(e) > 1 {
val = fmt.Sprintf("%v,", e[1])
}
}
return val
}
// defaultClusterName returns a kops cluster name to use when ClusterName is not set

View File

@ -47,6 +47,7 @@ type deployer struct {
ClusterName string `flag:"cluster-name" desc:"The FQDN to use for the cluster name"`
CloudProvider string `flag:"cloud-provider" desc:"Which cloud provider to use"`
Env []string `flag:"env" desc:"Additional env vars to set for kops commands in NAME=VALUE format"`
CreateArgs string `flag:"create-args" desc:"Extra space-separated arguments passed to 'kops create cluster'"`
KopsBinaryPath string `flag:"kops-binary-path" desc:"The path to kops executable used for testing"`
Networking string `flag:"networking" desc:"The networking mode to use"`
StateStore string `flag:"-"`

View File

@ -129,6 +129,12 @@ func (d *deployer) createCluster(zones []string, adminAccess string) error {
args = append(args, "--networking", d.Networking)
}
if d.CreateArgs != "" {
// TODO: we should only set the above flags if they're not in CreateArgs
// allowing any flag to be overridden
args = append(args, strings.Split(d.CreateArgs, " ")...)
}
klog.Info(strings.Join(args, " "))
cmd := exec.Command(args[0], args[1:]...)
cmd.SetEnv(d.env()...)