mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-11 22:12:23 +00:00
Fix PVE connection health key in registration check
The isKnownDisconnected helper was building the key as
instanceType+"-"+instanceName ("pve-delly"), but the PVE
PollProvider's connectionKey function returns the bare instance
name ("delly"). PBS uses "pbs-"+name. The mismatch meant the
disconnected-node check always missed, rendering the server-side
stale-token detection inert.
Fix: use type-specific key construction matching the PollProvider
connectionKey implementations.
This commit is contained in:
@@ -517,6 +517,10 @@ func (h *ConfigHandlers) autoRegisteredNodeExists(ctx context.Context, req *Auto
|
||||
// entry for the given instance. Returns false (i.e., assume connected) when
|
||||
// there is no monitor data yet so we don't mistakenly trigger re-registration
|
||||
// on every cold startup before the monitor has had a chance to poll.
|
||||
//
|
||||
// Key format must match the PollProvider connectionKey functions:
|
||||
// - pve: bare instance name (e.g. "delly")
|
||||
// - pbs: "pbs-" + instance name
|
||||
func isKnownDisconnected(connStatuses map[string]bool, instanceType, name, host string) bool {
|
||||
if connStatuses == nil {
|
||||
return false
|
||||
@@ -528,7 +532,15 @@ func isKnownDisconnected(connStatuses map[string]bool, instanceType, name, host
|
||||
if instanceName == "" {
|
||||
return false
|
||||
}
|
||||
key := instanceType + "-" + instanceName
|
||||
var key string
|
||||
switch instanceType {
|
||||
case "pve":
|
||||
key = instanceName // PVE connectionKey returns bare name
|
||||
case "pbs":
|
||||
key = "pbs-" + instanceName
|
||||
default:
|
||||
key = instanceType + "-" + instanceName
|
||||
}
|
||||
connected, known := connStatuses[key]
|
||||
return known && !connected
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user