Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Govern workloads link labels

rcourtmancf53b1b3972d
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 f43b257fa2..7ca46766c7 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -135,6 +135,10 @@ The shared infrastructure selector search path now also routes through that
same preferred resource display contract, so governed resources do not
reappear via raw-name search candidates while the selector stays on the same
hot-path budget.
+The shared workloads-link helper used by the resource drawer and table now
+also routes its Kubernetes-cluster fallback through the same preferred
+resource display contract, so navigation context does not leak raw
+`displayName` values for governed clusters.
The aggregate `/api/charts/workloads-summary` endpoint now also has its own
explicit API p95 budget constant, aligned with the per-workload charts budget,
and `internal/api/slo_bench_test.go` must fail if that aggregate budget or its
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 82eeb9afb4..069dee48ff 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -283,6 +283,10 @@ resource label no longer need to re-encode the governed summary boundary by
hand. Settings quick-picks, infrastructure selectors, and the connected-
infrastructure / monitored-system projections now all stay on that same
preferred-label helper instead of carrying a separate raw-name fallback fork.
+The shared workloads-link helper now also uses that preferred-label helper
+for Kubernetes-cluster navigation fallbacks, so drawer/table navigation
+context stays inside the same governed resource-label boundary instead of
+repeating a raw display-name fork.
That same contract also owns the canonical resource display-name fallback, so
name-or-ID presentation stays consistent between the unified AI adapter, the
AI resource context, and the shared resource selectors instead of being
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/workloadsLink.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/workloadsLink.test.ts
index 19b7065176..66d83fb2e4 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/workloadsLink.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/workloadsLink.test.ts
@@ -66,6 +66,22 @@ describe('buildWorkloadsHref', () => {
expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod&context=Fallback+Display');
});
+ it('uses the governed preferred display label for redacted k8s-cluster fallback', () => {
+ const resource = makeResource({
+ type: 'k8s-cluster',
+ platformType: 'kubernetes',
+ name: 'secret-cluster',
+ displayName: 'secret-cluster',
+ policy: {
+ sensitivity: 'restricted',
+ routing: { scope: 'local-only', redact: ['hostname'] },
+ },
+ aiSafeSummary: 'Governed Cluster',
+ });
+
+ expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod&context=Governed+Cluster');
+ });
+
it('falls back to resource.name when displayName is empty for k8s-cluster', () => {
const resource = makeResource({
type: 'k8s-cluster',
@@ -78,11 +94,13 @@ describe('buildWorkloadsHref', () => {
it('returns path without context when all k8s-cluster fields are empty', () => {
const resource = makeResource({
+ id: '',
type: 'k8s-cluster',
platformType: 'kubernetes',
name: '',
displayName: '',
clusterId: undefined,
+ platformId: '',
});
expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod');
});
diff --git a/frontend-modern/src/components/Infrastructure/workloadsLink.ts b/frontend-modern/src/components/Infrastructure/workloadsLink.ts
index fe842651cd..52bdb7d607 100644
--- a/frontend-modern/src/components/Infrastructure/workloadsLink.ts
+++ b/frontend-modern/src/components/Infrastructure/workloadsLink.ts
@@ -4,7 +4,10 @@ import {
getActionableDockerRuntimeIdFromResource,
hasDockerWorkloadsScope,
} from '@/utils/agentResources';
-import { getPreferredWorkloadsAgentHint } from '@/utils/resourceIdentity';
+import {
+ getPreferredResourceDisplayName,
+ getPreferredWorkloadsAgentHint,
+} from '@/utils/resourceIdentity';
type ProxmoxPlatformData = {
nodeName?: string;
@@ -44,8 +47,7 @@ const resolveKubernetesContext = (resource: Resource): string | undefined => {
kubernetes?.context,
kubernetes?.clusterId,
resource.clusterId,
- resource.displayName,
- resource.name,
+ getPreferredResourceDisplayName(resource),
]);
}
if (resource.type === 'k8s-node') {