From b349366dae9df0dc1917559e1d92c49bd1ff7b91 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Thu, 11 Jun 2026 11:10:56 +0100 Subject: [PATCH] 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. --- internal/api/router.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/api/router.go b/internal/api/router.go index 992878692..e898bbcf7 100644 --- a/internal/api/router.go +++ b/internal/api/router.go @@ -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 }