mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-23 03:33:53 +00:00
Fix agent infinite update loop on dev builds
The /api/agent/version endpoint was returning the git-describe version
(e.g. 6.0.0-rc.2+git.58.g53a9339.dirty) for dev builds, which is always
semantically newer than the binary's embedded version (v6.0.0-rc.1).
This caused agents to loop: check version → see "newer" → self-update →
restart → still same binary version → loop again.
The agent's guard ("skip if server reports 'dev'") only fires for the
literal string "dev". Fix: return "dev" whenever IsDevelopment is true,
which covers all git-built/dirty dev instances.
This commit is contained in:
@@ -4866,9 +4866,11 @@ func (r *Router) handleAgentVersion(w http.ResponseWriter, req *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
// Return the server version - all agents should match the server version
|
||||
// Return the server version - all agents should match the server version.
|
||||
// Dev/git builds return "dev" so agents don't enter an infinite update loop
|
||||
// (the agent skips updates when the server reports "dev").
|
||||
version := "dev"
|
||||
if versionInfo, err := updates.GetCurrentVersion(); err == nil {
|
||||
if versionInfo, err := updates.GetCurrentVersion(); err == nil && !versionInfo.IsDevelopment {
|
||||
version = versionInfo.Version
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user