fix: ensure proxmox nodes are displayed even if cluster endpoints are missing

Fixes #727. Previously, if temperature monitoring was enabled and a node wasn't found in ClusterEndpoints, the entire node processing was skipped. This change ensures we only skip temperature collection.
This commit is contained in:
courtmanr@gmail.com 2025-11-22 23:31:30 +00:00
parent f8647b53ff
commit d5fdf2f471

View file

@ -6165,6 +6165,7 @@ func (m *Monitor) pollPVEInstance(ctx context.Context, instanceName string, clie
// Prefer the resolved host for this node, with cluster overrides when available. // Prefer the resolved host for this node, with cluster overrides when available.
sshHost := modelNode.Host sshHost := modelNode.Host
foundNodeEndpoint := false foundNodeEndpoint := false
shouldCollect := true
if modelNode.IsClusterMember && instanceCfg.IsCluster { if modelNode.IsClusterMember && instanceCfg.IsCluster {
// For cluster members, wait until we have validated endpoints // For cluster members, wait until we have validated endpoints
@ -6175,9 +6176,8 @@ func (m *Monitor) pollPVEInstance(ctx context.Context, instanceName string, clie
Str("node", node.Node). Str("node", node.Node).
Str("instance", instanceCfg.Name). Str("instance", instanceCfg.Name).
Msg("Skipping temperature collection - cluster endpoints not yet validated") Msg("Skipping temperature collection - cluster endpoints not yet validated")
continue shouldCollect = false
} } else {
hasFingerprint := instanceCfg.Fingerprint != "" hasFingerprint := instanceCfg.Fingerprint != ""
for _, ep := range instanceCfg.ClusterEndpoints { for _, ep := range instanceCfg.ClusterEndpoints {
if strings.EqualFold(ep.NodeName, node.Node) { if strings.EqualFold(ep.NodeName, node.Node) {
@ -6198,10 +6198,12 @@ func (m *Monitor) pollPVEInstance(ctx context.Context, instanceName string, clie
Str("instance", instanceCfg.Name). Str("instance", instanceCfg.Name).
Int("endpointCount", len(instanceCfg.ClusterEndpoints)). Int("endpointCount", len(instanceCfg.ClusterEndpoints)).
Msg("Skipping temperature collection - node endpoint not found in cluster metadata") Msg("Skipping temperature collection - node endpoint not found in cluster metadata")
continue shouldCollect = false
}
} }
} }
if shouldCollect {
if strings.TrimSpace(sshHost) == "" { if strings.TrimSpace(sshHost) == "" {
sshHost = node.Node sshHost = node.Node
} }
@ -6278,6 +6280,7 @@ func (m *Monitor) pollPVEInstance(ctx context.Context, instanceName string, clie
Msg("Temperature data unavailable after collection") Msg("Temperature data unavailable after collection")
} }
} }
}
if m.pollMetrics != nil { if m.pollMetrics != nil {
nodeNameLabel := strings.TrimSpace(node.Node) nodeNameLabel := strings.TrimSpace(node.Node)