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 <irbe@tailscale.com>
Co-authored-by: Andrew Lytvynov <awly@tailscale.com>
pull/12316/head
Irbe Krumina 6 months ago committed by GitHub
parent 36d0ac6f8e
commit c2a4719e9e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -885,11 +885,26 @@ func checkForAccidentalSettingReverts(newPrefs, curPrefs *ipn.Prefs, env upCheck
// Issue 6811. Ignore on Synology. // Issue 6811. Ignore on Synology.
continue 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)) missing = append(missing, fmtFlagValueArg(flagName, valCur))
} }
if len(missing) == 0 { if len(missing) == 0 {
return nil return nil
} }
// Some previously provided flags are missing. This run of 'tailscale
// up' will error out.
sort.Strings(missing) sort.Strings(missing)
// Compute the stringification of the explicitly provided args in flagSet // Compute the stringification of the explicitly provided args in flagSet

Loading…
Cancel
Save