Restore LXC memory fallback to the cluster-resources listing

Real PVE guest RRD responses carry only the cache-inclusive mem/maxmem
columns; the cache-aware memused/memavailable columns exist only in node
RRD, so the LXC RRD branches can never match a live response. Removing
the cluster-resources fallback in bf67ba920 therefore left every running
LXC reporting unavailable memory, rendered as 0% (#1634).

Running containers now fall back to the listing value under the
low-trust cluster-resources source when cache-aware RRD evidence is
absent; unavailable remains reserved for running containers with no
listing evidence at all.

Fixes #1634

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
courtmanr@gmail.com 2026-07-27 17:12:24 +01:00
parent f45c08902e
commit 7d7d2b6a3b
4 changed files with 167 additions and 4 deletions

View file

@ -1053,7 +1053,7 @@ func TestHandleClusterContainerResourceMemoryTrustCharacterization(t *testing.T)
wantStatus: "running",
},
{
name: "running LXC without RRD memory stays unknown",
name: "running LXC without RRD memory falls back to cluster resources (#1634)",
res: proxmox.ClusterResource{
ID: "lxc/204",
Type: "lxc",
@ -1065,6 +1065,22 @@ func TestHandleClusterContainerResourceMemoryTrustCharacterization(t *testing.T)
Mem: 7 * gib,
MaxCPU: 4,
},
wantSource: "cluster-resources",
wantUsed: 7 * gib,
wantStatus: "running",
},
{
name: "running LXC without RRD memory or listing value stays unknown",
res: proxmox.ClusterResource{
ID: "lxc/206",
Type: "lxc",
Node: "node1",
Name: "ct-206",
Status: "running",
VMID: 206,
MaxMem: 8 * gib,
MaxCPU: 4,
},
wantSource: "unavailable",
wantStatus: "running",
wantUnknown: true,