Update log message to not print

This commit is contained in:
Owen
2026-06-12 15:44:43 -07:00
parent df93f01e74
commit 0019d0dc51
2 changed files with 10 additions and 1 deletions

View File

@@ -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)
}
}

View File

@@ -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" {