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:
rcourtman
2026-06-11 11:10:56 +01:00
parent 839c14f2a2
commit b349366dae
+4
View File
@@ -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
}