Skip to content
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

redeploy command without parameters #2379

Merged
merged 1 commit into from
Jan 6, 2025
Merged

redeploy command without parameters #2379

merged 1 commit into from
Jan 6, 2025

Conversation

axxyhtrx
Copy link
Contributor

@axxyhtrx axxyhtrx commented Jan 5, 2025

Fix for #2378.
Now it is possible to redeploy the lab with *.clab.yml|*.clab.yaml file in a folder without parameters:

anatoly@orb:~/containerlab/bin$ ls
containerlab  pr.clab.yaml
anatoly@orb:~/containerlab/bin$ sudo ./containerlab deploy
INFO[0000] Containerlab v0.0.0 started
INFO[0000] Parsing & checking topology file: pr.clab.yaml
INFO[0000] Creating lab directory: /home/anatoly/containerlab/bin/clab-srl01
INFO[0000] Creating container: "srl"
INFO[0000] Running postdeploy actions for Nokia SR Linux 'srl' node
INFO[0005] Adding containerlab host entries to /etc/hosts file
INFO[0005] Adding ssh config for containerlab nodes
INFO[0005] 🎉 New containerlab version 0.61.0 is available! Release notes: https://containerlab.dev/rn/0.61/
Run 'containerlab version upgrade' to upgrade or go check other installation options at https://containerlab.dev/install/
╭────────────────┬───────────────────────┬─────────┬───────────────────╮
│      Name      │       Kind/Image      │  State  │   IPv4/6 Address  │
├────────────────┼───────────────────────┼─────────┼───────────────────┤
│ clab-srl01-srl │ nokia_srlinux         │ running │ 172.20.20.4       │
│                │ ghcr.io/nokia/srlinux │         │ 3fff:172:20:20::4 │
╰────────────────┴───────────────────────┴─────────┴───────────────────╯
anatoly@orb:~/containerlab/bin$ sudo ./containerlab redeploy
INFO[0000] Parsing & checking topology file: pr.clab.yaml
INFO[0000] Parsing & checking topology file: pr.clab.yaml
INFO[0000] Destroying lab: srl01
INFO[0000] Removed container: clab-srl01-srl
INFO[0000] Removing containerlab host entries from /etc/hosts file
INFO[0000] Removing ssh config for containerlab nodes
INFO[0000] Containerlab v0.0.0 started
INFO[0000] Parsing & checking topology file: pr.clab.yaml
INFO[0000] Creating lab directory: /home/anatoly/containerlab/bin/clab-srl01
INFO[0000] Creating container: "srl"
INFO[0000] Running postdeploy actions for Nokia SR Linux 'srl' node
INFO[0003] Adding containerlab host entries to /etc/hosts file
INFO[0003] Adding ssh config for containerlab nodes
INFO[0003] 🎉 New containerlab version 0.61.0 is available! Release notes: https://containerlab.dev/rn/0.61/
Run 'containerlab version upgrade' to upgrade or go check other installation options at https://containerlab.dev/install/
╭────────────────┬───────────────────────┬─────────┬───────────────────╮
│      Name      │       Kind/Image      │  State  │   IPv4/6 Address  │
├────────────────┼───────────────────────┼─────────┼───────────────────┤
│ clab-srl01-srl │ nokia_srlinux         │ running │ 172.20.20.4       │
│                │ ghcr.io/nokia/srlinux │         │ 3fff:172:20:20::4 │
╰────────────────┴───────────────────────┴─────────┴───────────────────╯
anatoly@orb:~/containerlab/bin$ sudo ./containerlab destroy
INFO[0000] Parsing & checking topology file: pr.clab.yaml
INFO[0000] Parsing & checking topology file: pr.clab.yaml
INFO[0000] Destroying lab: srl01
INFO[0000] Removed container: clab-srl01-srl
INFO[0000] Removing containerlab host entries from /etc/hosts file
INFO[0000] Removing ssh config for containerlab nodes
anatoly@orb:~/containerlab/bin$```

@@ -101,7 +101,7 @@ func preRunFn(cmd *cobra.Command, _ []string) error {
// Errors if more than one file is found by the glob path.
func getTopoFilePath(cmd *cobra.Command) error {
// set commands which may use topo file find functionality, the rest don't need it
if !(cmd.Name() == "deploy" || cmd.Name() == "destroy" || cmd.Name() == "inspect" ||
if !(cmd.Name() == "deploy" || cmd.Name() == "destroy" || cmd.Name() == "redeploy" || cmd.Name() == "inspect" ||
Copy link
Member

Choose a reason for hiding this comment

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

lol

+1/-1 is my favorite type of PRs

@hellt hellt merged commit a837110 into srl-labs:main Jan 6, 2025
66 of 67 checks passed
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.85%. Comparing base (3065a43) to head (961afdc).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2379      +/-   ##
==========================================
- Coverage   51.88%   51.85%   -0.04%     
==========================================
  Files         173      173              
  Lines       17289    17289              
==========================================
- Hits         8971     8965       -6     
- Misses       7374     7379       +5     
- Partials      944      945       +1     
Files with missing lines Coverage Δ
cmd/root.go 72.72% <100.00%> (ø)

... and 1 file with indirect coverage changes

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