Skip to content

Commit 61cb2fb

Browse files
Ulexustalos-bot
authored andcommitted
feat: talosctl: allow v-prefixed k8s versions
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 <[email protected]>
1 parent c7ee239 commit 61cb2fb

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎cmd/talosctl/cmd/mgmt/cluster/create.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ func create(ctx context.Context) (err error) {
405405
&bundle.InputOptions{
406406
ClusterName: clusterName,
407407
Endpoint: fmt.Sprintf("https://%s:%d", defaultInternalLB, constants.DefaultControlPlanePort),
408-
KubeVersion: kubernetesVersion,
408+
KubeVersion: strings.TrimPrefix(kubernetesVersion, "v"),
409409
GenOptions: genOptions,
410410
}),
411411
)

‎cmd/talosctl/cmd/mgmt/config.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func genV1Alpha1Config(args []string) error {
145145
&bundle.InputOptions{
146146
ClusterName: args[0],
147147
Endpoint: args[1],
148-
KubeVersion: kubernetesVersion,
148+
KubeVersion: strings.TrimPrefix(kubernetesVersion, "v"),
149149
GenOptions: append(genOptions,
150150
generate.WithInstallDisk(installDisk),
151151
generate.WithInstallImage(installImage),

0 commit comments

Comments
 (0)