From 61cb2fb25c42a5e8f260adf3df4a989da9045ddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=C3=A1n=20C=20McCord?= Date: Thu, 25 Feb 2021 14:56:43 -0800 Subject: [PATCH] feat: talosctl: allow v-prefixed k8s versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Accept both `1.19.2` and `v1.19.2` formats for kubernetes versions in `talosctl gen`. Fixes #3155 Signed-off-by: Seán C McCord --- cmd/talosctl/cmd/mgmt/cluster/create.go | 2 +- cmd/talosctl/cmd/mgmt/config.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/talosctl/cmd/mgmt/cluster/create.go b/cmd/talosctl/cmd/mgmt/cluster/create.go index 1dbf108d35..2a2e108503 100644 --- a/cmd/talosctl/cmd/mgmt/cluster/create.go +++ b/cmd/talosctl/cmd/mgmt/cluster/create.go @@ -405,7 +405,7 @@ func create(ctx context.Context) (err error) { &bundle.InputOptions{ ClusterName: clusterName, Endpoint: fmt.Sprintf("https://%s:%d", defaultInternalLB, constants.DefaultControlPlanePort), - KubeVersion: kubernetesVersion, + KubeVersion: strings.TrimPrefix(kubernetesVersion, "v"), GenOptions: genOptions, }), ) diff --git a/cmd/talosctl/cmd/mgmt/config.go b/cmd/talosctl/cmd/mgmt/config.go index 05a4215447..eb66402875 100644 --- a/cmd/talosctl/cmd/mgmt/config.go +++ b/cmd/talosctl/cmd/mgmt/config.go @@ -145,7 +145,7 @@ func genV1Alpha1Config(args []string) error { &bundle.InputOptions{ ClusterName: args[0], Endpoint: args[1], - KubeVersion: kubernetesVersion, + KubeVersion: strings.TrimPrefix(kubernetesVersion, "v"), GenOptions: append(genOptions, generate.WithInstallDisk(installDisk), generate.WithInstallImage(installImage),