mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-20 10:18:25 +00:00
fix(api): count warning-status workloads as running in workloads summary
workloadSummaryStatusIsRunning treated every status except StatusOnline as
not running, so a guest at StatusWarning landed in the Stopped bucket.
Warning is an attention state on a running workload: statusFromGuest maps
degraded guest states to it (power-off maps to StatusOffline), and since
53faa4e46 the registry stale pass degrades online resources with stale
source sightings to it as well. That stale pass surfaced the bug as
provider-backed (VMware) VMs counting Total:1 Running:0 Stopped:1 in
TestContract_WorkloadChartsUseCanonicalWorkloadIDsForProviderBackedVMs and
TestHandleWorkloadsSummaryCharts_UsesCanonicalWorkloadIDsForVMwareVMs,
which seeded sightings older than the VMware stale threshold. Both pass
again with warning counted as running.
This commit is contained in:
@@ -8259,6 +8259,10 @@ func workloadSummaryStatusIsRunning(runtimeState string, status unifiedresources
|
||||
switch status {
|
||||
case unifiedresources.StatusOnline:
|
||||
return true
|
||||
case unifiedresources.StatusWarning:
|
||||
// Warning is an attention state on a running workload (degraded
|
||||
// guest state, stale source data); power-off maps to StatusOffline.
|
||||
return true
|
||||
case unifiedresources.StatusOffline:
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user