From c2a4719e9eed1641b7743b384feb13d54416b097 Mon Sep 17 00:00:00 2001 From: Irbe Krumina Date: Fri, 31 May 2024 22:42:32 +0100 Subject: [PATCH] cmd/tailscale/cli: allow 'tailscale up' to succeed if --stateful-filtering is not explicitly set on linux (#12312) This fixes an issue where, on containerized environments an upgrade 1.66.3 -> 1.66.4 failed with default containerboot configuration. This was because containerboot by default runs 'tailscale up' that requires all previously set flags to be explicitly provided on subsequent runs and we explicitly set --stateful-filtering to true on 1.66.3, removed that settingon 1.66.4. Updates tailscale/tailscale#12307 Signed-off-by: Irbe Krumina Co-authored-by: Andrew Lytvynov --- cmd/tailscale/cli/up.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cmd/tailscale/cli/up.go b/cmd/tailscale/cli/up.go index ffcc64497..c0bc3776d 100644 --- a/cmd/tailscale/cli/up.go +++ b/cmd/tailscale/cli/up.go @@ -885,11 +885,26 @@ func checkForAccidentalSettingReverts(newPrefs, curPrefs *ipn.Prefs, env upCheck // Issue 6811. Ignore on Synology. continue } + if flagName == "stateful-filtering" && valCur == true && valNew == false && env.goos == "linux" { + // See https://github.com/tailscale/tailscale/issues/12307 + // Stateful filtering was on by default in tailscale 1.66.0-1.66.3, then off in 1.66.4. + // This broke Tailscale installations in containerized + // environments that use the default containerboot + // configuration that configures tailscale using + // 'tailscale up' command, which requires that all + // previously set flags are explicitly provided on + // subsequent restarts. + continue + } missing = append(missing, fmtFlagValueArg(flagName, valCur)) } if len(missing) == 0 { return nil } + + // Some previously provided flags are missing. This run of 'tailscale + // up' will error out. + sort.Strings(missing) // Compute the stringification of the explicitly provided args in flagSet