From aa5585459d242e4c3d41ff42c5f8d6a4df626b88 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Mon, 12 Aug 2024 12:01:15 -0700 Subject: [PATCH] fix: id for service <> link in visualizer fixed --- ui/src/lib/kubernetes-visualize.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ui/src/lib/kubernetes-visualize.ts b/ui/src/lib/kubernetes-visualize.ts index cfe9d01..810e9e8 100644 --- a/ui/src/lib/kubernetes-visualize.ts +++ b/ui/src/lib/kubernetes-visualize.ts @@ -140,9 +140,6 @@ export async function visualizeTopology(namespace: string, name: string): Promis const recordedTunnels: Record = {}; - // @ts-ignore-error - const connectivityNameLabel = connectivity.data?.metadata?.labels["clabernetes/name"]; - // doing this to de-dup things because we have both sides of tunnels represented basically for (const tunnelDefinitions of Object.values( connectivity.data?.spec?.pointToPointTunnels ?? {}, @@ -154,9 +151,9 @@ export async function visualizeTopology(namespace: string, name: string): Promis recordedTunnels[tunnelDefinition.tunnelID] = true; - const localFabricService = `svc/${connectivityNameLabel}-${tunnelDefinition.localNode}-vx`; + const localFabricService = `svc/${tunnelDefinition.localNode}-vx`; const localInterface = `${tunnelDefinition.localNode}-${tunnelDefinition.localInterface}`; - const remoteFabricService = `svc/${connectivityNameLabel}-${tunnelDefinition.remoteNode}-vx`; + const remoteFabricService = `svc/${tunnelDefinition.remoteNode}-vx`; const remoteInterface = `${tunnelDefinition.remoteNode}-${tunnelDefinition.remoteInterface}`; nodes.push({ @@ -201,6 +198,11 @@ export async function visualizeTopology(namespace: string, name: string): Promis } } + console.log(JSON.stringify({ + edges: edges, + nodes: nodes, + })) + return JSON.stringify({ edges: edges, nodes: nodes,