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 d17ca30
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/on_pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ jobs:
sudo install kubectl /usr/local/bin/kubectl
- name: Install podman
run: |
sudo apt-get -y install podman
sudo apt-get update
sudo apt-get -y install podman --fix-missing
- name: Create Cluster
run: |
Expand Down
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 d17ca30

Please sign in to comment.