From 0019d0dc51176f73943cdf4527f5f7604f129d04 Mon Sep 17 00:00:00 2001 From: Owen Date: Fri, 12 Jun 2026 15:44:43 -0700 Subject: [PATCH] Update log message to not print --- main.go | 4 ++++ updates/selfupdate.go | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 8f5d0ce..9686f6f 100644 --- a/main.go +++ b/main.go @@ -691,6 +691,10 @@ func runNewtMain(ctx context.Context) { Platform: newtPlatform, TLSConfig: tlsCfg, }); err != nil { + if errors.Is(err, updates.ErrAutoUpdateUnsupportedInOfficialContainer) { + logger.Debug("checkAndSelfUpdate: auto-update skipped: %v", err) + return + } logger.Error("Auto-update check failed: %v", err) } } diff --git a/updates/selfupdate.go b/updates/selfupdate.go index c828236..2e12a5f 100644 --- a/updates/selfupdate.go +++ b/updates/selfupdate.go @@ -7,6 +7,7 @@ import ( "crypto/tls" "encoding/hex" "encoding/json" + "errors" "fmt" "io" "net/http" @@ -50,6 +51,10 @@ type versionResponse struct { Message string `json:"message"` } +// ErrAutoUpdateUnsupportedInOfficialContainer indicates auto-update is not +// available when running inside official Fossorial container images. +var ErrAutoUpdateUnsupportedInOfficialContainer = errors.New("auto-update unsupported in official Fossorial container images") + // isOfficialContainer returns true when the process is running inside an // official Fossorial-built container image. The image sets // NEWT_SYSTEM_SUBSTRATE="CONTAINER" at build time; users running newt in their own @@ -113,7 +118,7 @@ func CheckAndSelfUpdate(cfg SelfUpdateConfig) error { if isOfficialContainer() { logger.Debug("checkAndSelfUpdate: running inside official container, skipping auto-update") - return fmt.Errorf("auto-update is not supported in official Fossorial container images; pull a new image tag instead") + return fmt.Errorf("%w; pull a new image tag instead", ErrAutoUpdateUnsupportedInOfficialContainer) } if cfg.CurrentVersion == "version_replaceme" {