diff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md index 5ef7fff2f..a5feb5852 100644 --- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md +++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md @@ -144,6 +144,10 @@ share the canonical cluster-name helpers in the shared agent-resource layer, so route labels, pod grouping, and cluster-name fetch keys keep using the same source of truth instead of rebuilding the `clusterName`/`context`/ `clusterId` prefix locally. +The shared node adapter also uses that same cluster-name helper for the +infrastructure summary surface, so Proxmox node projections stay aligned with +the same canonical cluster label instead of carrying a raw adapter-local +cluster string. The drawer's Kubernetes namespace/deployment tabs use the canonical cluster-name helper for fetch keys, so the visible navigation label stays separate from the backend cluster lookup contract. diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md index d00530024..5981ab26c 100644 --- a/docs/release-control/v6/internal/subsystems/unified-resources.md +++ b/docs/release-control/v6/internal/subsystems/unified-resources.md @@ -176,6 +176,10 @@ The same shared agent-resource module now also owns the canonical cluster-name helpers, so Kubernetes context prefixes, Proxmox cluster labels, and cluster-name fetch keys stay aligned instead of each surface rebuilding its own pod, namespace, and VM routing fallbacks. +The shared node-state adapter also routes Proxmox cluster labels through that +same helper, so infrastructure summary projections keep the same canonical +cluster name as the rest of the unified resource model instead of rewriting +the label locally. The canonical unified-resource change and relationship presenters now also share the same elapsed-time and "ago" wording utilities, so `observed`, `last seen`, and `ago` fragments stay consistent without each formatter diff --git a/frontend-modern/src/utils/__tests__/resourceStateAdapters.test.ts b/frontend-modern/src/utils/__tests__/resourceStateAdapters.test.ts index e683070e8..57fd36d4f 100644 --- a/frontend-modern/src/utils/__tests__/resourceStateAdapters.test.ts +++ b/frontend-modern/src/utils/__tests__/resourceStateAdapters.test.ts @@ -88,6 +88,20 @@ describe('resourceStateAdapters nodeFromResource', () => { expect(node?.displayName).toBe('Tower'); expect(node?.host).toBe('tower.local'); expect(node?.instance).toBe('pve-canonical'); + expect(node?.clusterName).toBeUndefined(); + }); + + it('projects the canonical cluster name through the shared helper', () => { + const node = nodeFromResource( + createNodeResource({ + proxmox: { + nodeName: 'pve-node-1', + clusterName: 'cluster-a', + }, + }), + ); + + expect(node?.clusterName).toBe('cluster-a'); }); it('maps PBS display and host identity through shared resource helpers', () => { diff --git a/frontend-modern/src/utils/resourceStateAdapters.ts b/frontend-modern/src/utils/resourceStateAdapters.ts index 0eaaac197..25b9c56da 100644 --- a/frontend-modern/src/utils/resourceStateAdapters.ts +++ b/frontend-modern/src/utils/resourceStateAdapters.ts @@ -23,6 +23,7 @@ import type { import type { Resource } from '@/types/resource'; import { getActionableAgentIdFromResource } from '@/utils/agentResources'; import { + getPreferredResourceClusterName, getPreferredResourceDisplayName, getPreferredResourceHostname, } from '@/utils/resourceIdentity'; @@ -232,7 +233,7 @@ export const nodeFromResource = (resource: Resource): Node | null => { lastSeen: toISOTime(undefined, resource.lastSeen), connectionHealth: asString(proxmox?.connectionHealth) || resource.status || 'unknown', isClusterMember: asBoolean(proxmox?.isClusterMember), - clusterName: asString(proxmox?.clusterName), + clusterName: getPreferredResourceClusterName(resource), linkedAgentId, }; };