Skip to content

Conversation

@ipspace
Copy link
Owner

@ipspace ipspace commented Jan 15, 2026

This change makes it the definition of Linux deployment scripts less error-prone as the 'clab' provider creates all the necessary node_config entries.

This change makes it the definition of Linux deployment scripts less
error-prone as the 'clab' provider creates all the necessary
node_config entries.
@ipspace ipspace requested review from Copilot and jbemmel January 15, 2026 13:26
@ipspace
Copy link
Owner Author

ipspace commented Jan 15, 2026

@jbemmel -- what you asked for a while ago

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies containerlab configuration by introducing a config_mode parameter that replaces explicit node_config dictionary entries. Instead of manually listing each module with its execution mode, devices can now specify a single config_mode value (e.g., 'sh' or 'ns'), and the clab provider automatically generates the necessary configuration entries.

Changes:

  • Added add_default_config_mode() function to automatically populate _node_config based on the device's config_mode setting
  • Replaced explicit node_config entries with config_mode: ns in linux.yml
  • Replaced explicit node_config entries with config_mode: sh in bird.yml
  • Updated documentation to explain the new config_mode parameter with examples

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
netsim/providers/clab.py Implements add_default_config_mode() function and integrates it into the node transformation pipeline
netsim/devices/linux.yml Simplifies configuration by using config_mode: ns instead of explicit node_config entries
netsim/daemons/bird.yml Simplifies configuration by using config_mode: sh instead of explicit node_config entries
docs/dev/config/deploy.md Documents the new config_mode parameter with usage examples and migration guidance
Comments suppressed due to low confidence (1)

netsim/providers/clab.py:1

  • The 'ns' mode is not handled in the file_target assignment logic. Based on the old linux.yml configuration showing 'initial: :ns', the 'ns' mode should set file_target to an empty string (indicated by the colon with no path before it). However, the current code leaves file_target as an empty string for 'ns' mode implicitly rather than explicitly, which could be confusing. Consider adding an explicit elif clause for 'ns' mode or adding a comment explaining that empty file_target is intentional for 'ns' mode.
#

routing: :ns
```

The **clab.config_mode parameter** can be used to replace these definitions with a simpler one:
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra space in 'clab.config_mode parameter**' - should be 'clab.config_mode** parameter'

Suggested change
The **clab.config_mode parameter** can be used to replace these definitions with a simpler one:
The **clab.config_mode** parameter can be used to replace these definitions with a simpler one:

Copilot uses AI. Check for mistakes.
ipspace added a commit that referenced this pull request Jan 15, 2026
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.

2 participants