From 8a5b02133dc67bec6f1eaae35687df3ea8f17683 Mon Sep 17 00:00:00 2001 From: Andrew Lytvynov Date: Mon, 16 Oct 2023 09:14:14 -0700 Subject: [PATCH] clientupdate: return ErrUnsupported for macSys clients (#9793) The Sparkle-based update is not quite working yet. Make `NewUpdater` return `ErrUnsupported` for it to avoid the proliferation of exceptions up the stack. Updates #755 Signed-off-by: Andrew Lytvynov --- clientupdate/clientupdate.go | 4 +++- ipn/ipnlocal/c2n.go | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/clientupdate/clientupdate.go b/clientupdate/clientupdate.go index ccd67246b..b42d912a9 100644 --- a/clientupdate/clientupdate.go +++ b/clientupdate/clientupdate.go @@ -185,7 +185,9 @@ func (up *Updater) getUpdateFunction() updateFunction { case !up.Arguments.AppStore && !version.IsSandboxedMacOS(): return nil case !up.Arguments.AppStore && strings.HasSuffix(os.Getenv("HOME"), "/io.tailscale.ipn.macsys/Data"): - return up.updateMacSys + // TODO(noncombatant): return up.updateMacSys when we figure out why + // Sparkle update doesn't work when running "tailscale update". + return nil default: return up.updateMacAppStore } diff --git a/ipn/ipnlocal/c2n.go b/ipn/ipnlocal/c2n.go index 880a783ee..e5510e2b9 100644 --- a/ipn/ipnlocal/c2n.go +++ b/ipn/ipnlocal/c2n.go @@ -261,8 +261,6 @@ func (b *LocalBackend) handleC2NPostureIdentityGet(w http.ResponseWriter, r *htt func (b *LocalBackend) newC2NUpdateResponse() tailcfg.C2NUpdateResponse { // If NewUpdater does not return an error, we can update the installation. - // Exception: When version.IsMacSysExt returns true, we don't support that - // yet. TODO(cpalmer, #6995): Implement it. // // Note that we create the Updater solely to check for errors; we do not // invoke it here. For this purpose, it is ok to pass it a zero Arguments. @@ -270,7 +268,7 @@ func (b *LocalBackend) newC2NUpdateResponse() tailcfg.C2NUpdateResponse { _, err := clientupdate.NewUpdater(clientupdate.Arguments{}) return tailcfg.C2NUpdateResponse{ Enabled: envknob.AllowsRemoteUpdate() || prefs.Apply, - Supported: err == nil && !version.IsMacSysExt(), + Supported: err == nil, } }