Skip to content

fix(labs): report the root node of sub-containers in lab inspect - #199

Merged
FloSch62 merged 1 commit into
mainfrom
fix/inspect-root-node-name
Nov 13, 2026
Merged

FloSch62 merged 1 commit into
mainfrom
fix/inspect-root-node-name

Conversation

@FloSch62

Copy link
Copy Markdown
Member

Summary

A distributed nokia_srsim node (e.g. type: sr-7s with components) runs as several containers, one per CPM and card. Each has its own clab-node-name (dist-a, dist-1), and lab inspect reported that as nodeName. A client that captures a port of such a container passes that name as the node, and the capture fails:

invalid capture target: node "dist-1" is not part of lab "apicap"; nodes: dist, integ

Lab inspect now also reports rootNodeName, taken from the clab-root-node-name label. It's the topology node the container belongs to and is omitted for other nodes. The containerlab-app API backend already uses rootNodeName first 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

  • New unit test TestContainerToClabContainerInfoReportsRootNodeName. go test ./internal/... passes; golangci-lint run --new-from-rev=origin/main reports 0 issues. Swagger docs were regenerated with swag init.
  • Live, on a Docker lab with a distributed SR-SIM dist (sr-7s) linked to an integrated SR-SIM integ, using containerlab-app's API backend:
Container main this branch (server run as root)
clab-apicap-dist-1 node "dist-1" is not part of lab captures dist:e1-1-c1-1, 3 ARP packets
clab-apicap-dist-a node "dist-a" is not part of lab captures dist:e1-1-c1-1, 3 ARP packets
clab-apicap-integ works captures integ:e1-1-c1-1, 3 ARP packets

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.
@FloSch62
FloSch62 merged commit c29660e into main Nov 13, 2026
3 checks passed
@FloSch62
FloSch62 deleted the fix/inspect-root-node-name branch November 13, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant