From 70c356bfdaedc4eaabb383560da02daab23374c9 Mon Sep 17 00:00:00 2001 From: Mateusz Urbanek Date: Fri, 3 Apr 2026 07:40:32 +0200 Subject: [PATCH] feat: add flag to force fallback to legacy upgrade Forcing fallback to legacy flow, might be wanted by some users. Signed-off-by: Mateusz Urbanek (cherry picked from commit 7b6ab0c1c3cec7b6260e27dd5b6e72faa1975ab0) --- cmd/talosctl/cmd/talos/upgrade.go | 8 ++++++++ website/content/v1.13/reference/cli.md | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cmd/talosctl/cmd/talos/upgrade.go b/cmd/talosctl/cmd/talos/upgrade.go index 517d0c77e..f06af491c 100644 --- a/cmd/talosctl/cmd/talos/upgrade.go +++ b/cmd/talosctl/cmd/talos/upgrade.go @@ -41,6 +41,7 @@ var upgradeCmdFlags = struct { rebootMode flags.PflagExtended[machine.RebootRequest_Mode] progress flags.PflagExtended[reporter.OutputMode] + legacy bool force bool // Deprecated: only used for legacy upgrade path, to be removed in Talos 1.18. insecure bool // Deprecated: only used for legacy upgrade path, to be removed in Talos 1.18. preserve bool // Deprecated: only used for legacy upgrade path, to be removed in Talos 1.18. @@ -82,6 +83,12 @@ func upgradeViaLifecycleService(ctx context.Context, c *client.Client, nodes []s upgradeCmdFlags.wait = true } + if upgradeCmdFlags.legacy { + cli.Warning("Forcing use of legacy upgrade method. This flag is deprecated and will be removed in Talos 1.18.") + + return upgradeLegacy() + } + opts := []client.RebootMode{ client.WithRebootMode(upgradeCmdFlags.rebootMode.Value()), } @@ -325,6 +332,7 @@ func init() { // // Note: remove me in Talos 1.18. upgradeCmdFlags.addTrackActionFlags(upgradeCmd) + upgradeCmd.Flags().BoolVar(&upgradeCmdFlags.legacy, "legacy", false, "force use of legacy upgrade method") upgradeCmd.Flags().BoolVarP(&upgradeCmdFlags.force, "force", "f", false, "force the upgrade (skip checks on etcd health and members, might lead to data loss)") upgradeCmd.Flags().BoolVar(&upgradeCmdFlags.insecure, "insecure", false, "upgrade using the insecure (encrypted with no auth) maintenance service") upgradeCmd.Flags().BoolVarP(&upgradeCmdFlags.preserve, "preserve", "p", false, "preserve data") diff --git a/website/content/v1.13/reference/cli.md b/website/content/v1.13/reference/cli.md index 19c225868..06681c154 100644 --- a/website/content/v1.13/reference/cli.md +++ b/website/content/v1.13/reference/cli.md @@ -2932,7 +2932,7 @@ for e.g. Wireguard tunnels: As packet capture is transmitted over the network, it is recommended to filter out the Talos API traffic, e.g. by excluding packets with the port 50000. - + ``` ### Options @@ -3332,6 +3332,7 @@ talosctl upgrade [flags] -e, --endpoints strings override default endpoints in Talos configuration -h, --help help for upgrade -i, --image string the container image to use for performing the install (default "ghcr.io/siderolabs/installer:v1.13.0-beta.1") + --legacy force use of legacy upgrade method --namespace string namespace to use: "system" (etcd and kubelet images), "cri" for all Kubernetes workloads, "inmem" for in-memory containerd instance (default "system") -n, --nodes strings target the specified nodes --progress string output mode for upgrade progress. Values: [auto plain] (default "auto") @@ -3587,4 +3588,3 @@ A CLI for out-of-band management of Kubernetes nodes created by Talos * [talosctl validate](#talosctl-validate) - Validate config * [talosctl version](#talosctl-version) - Prints the version * [talosctl wipe](#talosctl-wipe) - Wipe block device or volumes -