mirror of
https://github.com/tailscale/tailscale.git
synced 2026-04-04 06:36:01 -04:00
When Headscale sends MapResponse.Debug.DisableLogTail, the client previously called envknob.SetNoLogsNoSupport(), permanently latching the global no-logs-no-support flag for the process lifetime. This meant users switching from a Headscale tailnet to a Tailscale tailnet with Network Flow Logs could not connect without restarting tailscaled. Replace the global envknob.SetNoLogsNoSupport() call in handleDebugMessage with a per-instance callback (OnDisableLogTail) that sets an atomic.Bool on LocalBackend. This flag follows the control client lifecycle: it is cleared in startLocked() when a new control client is created (profile switch, re-login, etc.). If the new control server also wants logging disabled, it will re-send DisableLogTail in its first MapResponse. The global user-set flag (--no-logs-no-support / TS_NO_LOGS_NO_SUPPORT) is unchanged and always takes precedence. Also improve the error message shown when a tailnet requires logging: differentiate between the user-explicit case (tells user to restart without the flag) and the control-server case (tells user to restart). Fixes #15048