mirror of https://github.com/kubernetes/kops.git
Support a --kubernetes-version flag that is passed to `kops create cluster`
This commit is contained in:
parent
1c96e826d9
commit
0ac86d13e3
1
Makefile
1
Makefile
|
|
@ -197,6 +197,7 @@ test-e2e:
|
|||
--build --up --down \
|
||||
--cloud-provider=aws \
|
||||
--kops-binary-path=/home/prow/go/src/k8s.io/kops/bazel-bin/cmd/kops/linux-amd64/kops \
|
||||
--kubernetes-version=v1.19.4 \
|
||||
--test=ginkgo \
|
||||
-- \
|
||||
--test-package-version=v1.19.4 \
|
||||
|
|
|
|||
|
|
@ -50,6 +50,11 @@ func (d *deployer) initialize() error {
|
|||
return fmt.Errorf("init failed to check up flags: %v", err)
|
||||
}
|
||||
}
|
||||
if d.commonOptions.ShouldUp() || d.commonOptions.ShouldTest() {
|
||||
if d.KubernetesVersion == "" {
|
||||
return errors.New("missing required --kubernetes-version flag")
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ type deployer struct {
|
|||
KopsBinaryPath string `flag:"kops-binary-path" desc:"The path to kops executable used for testing"`
|
||||
StateStore string `flag:"-"`
|
||||
|
||||
KubernetesVersion string `flag:"kubernetes-version" desc:"The kubernetes version to use in the cluster"`
|
||||
|
||||
SSHPrivateKeyPath string `flag:"ssh-private-key" desc:"The path to the private key used for SSH access to instances"`
|
||||
SSHPublicKeyPath string `flag:"ssh-public-key" desc:"The path to the public key passed to the cloud provider"`
|
||||
SSHUser []string `flag:"ssh-user" desc:"The SSH users to use for SSH access to instances"`
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ func (d *deployer) Up() error {
|
|||
"--name", d.ClusterName,
|
||||
"--admin-access", publicIP,
|
||||
"--cloud", d.CloudProvider,
|
||||
"--kubernetes-version", d.KubernetesVersion,
|
||||
"--master-count", "1",
|
||||
"--master-size", "c5.large",
|
||||
"--master-volume-size", "48",
|
||||
|
|
@ -57,6 +58,7 @@ func (d *deployer) Up() error {
|
|||
"--zones", strings.Join(zones, ","),
|
||||
"--yes",
|
||||
}
|
||||
|
||||
klog.Info(strings.Join(args, " "))
|
||||
cmd := exec.Command(args[0], args[1:]...)
|
||||
cmd.SetEnv(d.env()...)
|
||||
|
|
|
|||
Loading…
Reference in New Issue