Repository navigation
fix(labs): report the root node of sub-containers in lab inspect - #199
Merged
Merged
Conversation
A distributed SR-SIM node runs as several containers (CPM, cards), each with its own clab-node-name such as sr1-a or sr1-1. Clients that capture through the API took that name as the topology node, and the capture failed with "node sr1-1 is not part of lab". Lab inspect now also reports rootNodeName from the clab-root-node-name label, the topology node the container belongs to.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A distributed
nokia_srsimnode (e.g.type: sr-7swith components) runs as several containers, one per CPM and card. Each has its ownclab-node-name(dist-a,dist-1), and lab inspect reported that asnodeName. A client that captures a port of such a container passes that name as the node, and the capture fails:Lab inspect now also reports
rootNodeName, taken from theclab-root-node-namelabel. It's the topology node the container belongs to and is omitted for other nodes. The containerlab-app API backend already usesrootNodeNamefirst when it maps a container to a capture node, so no client change is needed.Related: srl-labs/containerlab-app#158, srl-labs/containerlab-app#159
Testing
TestContainerToClabContainerInfoReportsRootNodeName.go test ./internal/...passes;golangci-lint run --new-from-rev=origin/mainreports 0 issues. Swagger docs were regenerated withswag init.dist(sr-7s) linked to an integrated SR-SIMinteg, using containerlab-app's API backend:mainclab-apicap-dist-1node "dist-1" is not part of labdist:e1-1-c1-1, 3 ARP packetsclab-apicap-dist-anode "dist-a" is not part of labdist:e1-1-c1-1, 3 ARP packetsclab-apicap-integinteg:e1-1-c1-1, 3 ARP packets