Skip to content

Commit

Permalink
fix: strip 'v' prefix from versions on Kubernetes upgrade
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
smira committed Apr 22, 2022
1 parent ec62147 commit f1f4313
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/cluster/kubernetes/talos_managed.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ var deprecations = map[string][]string{
//
//nolint:gocyclo,cyclop
func UpgradeTalosManaged(ctx context.Context, cluster UpgradeProvider, options UpgradeOptions) error {
// strip leading `v` from Kubernetes version
options.FromVersion = strings.TrimLeft(options.FromVersion, "v")
options.ToVersion = strings.TrimLeft(options.ToVersion, "v")

switch path := options.Path(); path {
// nothing for all those
case "1.19->1.19":
Expand Down

0 comments on commit f1f4313

Please sign in to comment.