Skip to content

Commit

Permalink
fix: id for service <> link in visualizer fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
carlmontanari committed Aug 12, 2024
1 parent 6e4d416 commit aa55854
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ui/src/lib/kubernetes-visualize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ export async function visualizeTopology(namespace: string, name: string): Promis

const recordedTunnels: Record<number, boolean> = {};

// @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 ?? {},
Expand All @@ -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({
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit aa55854

Please sign in to comment.