Skip to content

Commit 84c1001

Browse files
committed
fix: strip 'v' prefix from versions on Kubernetes upgrade
This fixes an issue when `talosctl upgrade-k8s` fails with unhelpful message if the version is specified as `v1.23.5` vs. `1.23.5`. Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com> (cherry picked from commit f1f4313)
1 parent d5a823a commit 84c1001

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/cluster/kubernetes/talos_managed.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ var deprecations = map[string][]string{
6666
//
6767
//nolint:gocyclo,cyclop
6868
func UpgradeTalosManaged(ctx context.Context, cluster UpgradeProvider, options UpgradeOptions) error {
69+
// strip leading `v` from Kubernetes version
70+
options.FromVersion = strings.TrimLeft(options.FromVersion, "v")
71+
options.ToVersion = strings.TrimLeft(options.ToVersion, "v")
72+
6973
switch path := options.Path(); path {
7074
// nothing for all those
7175
case "1.19->1.19":

0 commit comments

Comments
 (0)