mirror of
https://github.com/fosrl/newt.git
synced 2026-09-07 14:41:27 +02:00
Update log message to not print
This commit is contained in:
4
main.go
4
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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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" {
|
||||
|
||||
Reference in New Issue
Block a user