fix: set PBS status to offline when connection fails (addresses #326)

When both GetVersion and GetDatastores fail for PBS, properly set the
Status field to 'offline' and ConnectionHealth to 'error'. This prevents
the red dot from appearing when the instance state is undefined.
This commit is contained in:
Pulse Monitor
2025-08-17 19:06:06 +00:00
parent 50e06f2580
commit 2efb4326bf
+2
View File
@@ -1516,6 +1516,8 @@ func (m *Monitor) pollPBSInstance(ctx context.Context, instanceName string, clie
Msg("PBS connected (version unavailable but datastores accessible)")
} else {
// Both failed - PBS is offline
pbsInst.Status = "offline"
pbsInst.ConnectionHealth = "error"
monErr := errors.WrapConnectionError("get_pbs_version", instanceName, versionErr)
log.Error().Err(monErr).Str("instance", instanceName).Msg("Failed to connect to PBS")
m.state.SetConnectionHealth("pbs-"+instanceName, false)