-
Notifications
You must be signed in to change notification settings - Fork 99
Implement default configuration deployment mode (sh/ns) for containers #3022
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
This change makes it the definition of Linux deployment scripts less error-prone as the 'clab' provider creates all the necessary node_config entries.
|
@jbemmel -- what you asked for a while ago |
There was a problem hiding this 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_configbased on the device'sconfig_modesetting - Replaced explicit
node_configentries withconfig_mode: nsin linux.yml - Replaced explicit
node_configentries withconfig_mode: shin bird.yml - Updated documentation to explain the new
config_modeparameter 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.
#
docs/dev/config/deploy.md
Outdated
| routing: :ns | ||
| ``` | ||
|
|
||
| The **clab.config_mode parameter** can be used to replace these definitions with a simpler one: |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
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'
| 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: |
This change makes it the definition of Linux deployment scripts less error-prone as the 'clab' provider creates all the necessary node_config entries.