Przeglądaj źródła

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 <[email protected]>
Andrew Lytvynov 2 lat temu
rodzic
commit
8a5b02133d
2 zmienionych plików z 4 dodań i 4 usunięć
  1. 3 1
      clientupdate/clientupdate.go
  2. 1 3
      ipn/ipnlocal/c2n.go

+ 3 - 1
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
 		}

+ 1 - 3
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,
 	}
 }