Skip to content
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.

Commit

Permalink
CNV-51884: The topology view of nmstate is broken on cnv2.engineering
Browse files Browse the repository at this point in the history
Signed-off-by: Aviv Turgeman <[email protected]>
  • Loading branch information
avivtur committed Nov 25, 2024
1 parent 2d07317 commit 116c10b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/views/states/topology/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ const createNodes = (
const createEdges = (childNodes: NodeModel[]): EdgeModel[] => {
const edges: EdgeModel[] = [];

childNodes.forEach((sourceNode) => {
childNodes?.forEach((sourceNode) => {
// Find bridge connections
if (!isEmpty(sourceNode.data?.bridgePorts)) {
sourceNode.data?.bridgePorts.forEach((port) => {
sourceNode.data?.bridgePorts?.forEach((port) => {
const targetNode = childNodes.find(
(target) => target.label === port.name && target.id !== sourceNode.id,
);
Expand All @@ -83,7 +83,7 @@ const createEdges = (childNodes: NodeModel[]): EdgeModel[] => {

// Find bond connections
if (!isEmpty(sourceNode.data?.vlanBaseInterface)) {
sourceNode.data?.bondPorts.forEach((port) => {
sourceNode.data?.bondPorts?.forEach((port) => {
const targetNode = childNodes.find(
(target) => target.label === port && target.id !== sourceNode.id,
);
Expand Down Expand Up @@ -145,7 +145,7 @@ export const transformDataToTopologyModel = (
const nodes: NodeModel[] = [];
const edges: EdgeModel[] = [];

data.forEach((nodeState) => {
data?.forEach((nodeState) => {
const nnsName = nodeState.metadata.name;

const childNodes = createNodes(nnsName, nodeState.status.currentState.interfaces);
Expand Down

0 comments on commit 116c10b

Please sign in to comment.