fix(nodes): report dev builds as dev+<commit> so updated nodes aren't flagged stale

A node's status reported config.GetVersion() (3.4.0) even on a dev build, so the master compared it against its own dev latestVersion (dev+<sha>) and every node showed 'update available'. Nodes on a dev build now report dev+<short commit>, matching the master's format, so a node on the current dev commit compares as up to date.
This commit is contained in:
MHSanaei
2026-06-25 00:46:43 +02:00
parent e8878b71a4
commit bcd1358032
3 changed files with 37 additions and 1 deletions
+16
View File
@@ -68,6 +68,22 @@ func IsDevBuild() bool {
return GetBuildCommit() != ""
}
// GetReportedVersion returns the version a panel advertises to a managing master
// node: the plain version for stable builds, or "dev+<short commit>" for dev
// builds. The dev form mirrors the master's getPanelUpdateInfo latestVersion so
// a node on the current dev commit compares as up to date instead of always
// showing "update available".
func GetReportedVersion() string {
if !IsDevBuild() {
return GetVersion()
}
commit := GetBuildCommit()
if len(commit) > 8 {
commit = commit[:8]
}
return "dev+" + commit
}
// GetLogLevel returns the current logging level based on environment variables or defaults to Info.
func GetLogLevel() LogLevel {
if IsDebug() {