Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Fix agent self-update infinite loop due to version prefix mismatch

rcourtman3d80ac9bf166
diff --git a/internal/agentupdate/update.go b/internal/agentupdate/update.go
index 6c3bcf7e97..61451619a9 100644
--- a/internal/agentupdate/update.go
+++ b/internal/agentupdate/update.go
@@ -156,7 +156,10 @@ func (u *Updater) CheckAndUpdate(ctx context.Context) {
return
}
- if serverVersion == u.cfg.CurrentVersion {
+ // Normalize both versions by stripping "v" prefix for comparison.
+ // Server returns version without prefix (e.g., "4.33.1"), but agent's
+ // CurrentVersion may include it (e.g., "v4.33.1") depending on build.
+ if normalizeVersion(serverVersion) == normalizeVersion(u.cfg.CurrentVersion) {
u.logger.Debug().Str("version", u.cfg.CurrentVersion).Msg("Agent is up to date")
return
}
@@ -437,6 +440,11 @@ func (u *Updater) performUpdate(ctx context.Context) error {
return nil
}
+// normalizeVersion strips the "v" prefix from version strings for comparison.
+func normalizeVersion(version string) string {
+ return strings.TrimPrefix(strings.TrimSpace(version), "v")
+}
+
// determineArch returns the architecture string for download URLs (e.g., "linux-amd64", "darwin-arm64").
func determineArch() string {
os := runtime.GOOS