srl-labs / containerlab

container-based networking labs
https://containerlab.dev
BSD 3-Clause "New" or "Revised" License
1.56k stars 266 forks source link

Cleanup fails when bind files are no longer available #2298

Open jbemmel opened 5 days ago

jbemmel commented 5 days ago

During sudo clab destroy --cleanup -t lab.yml:

Error: failed to verify bind path: stat /home/jeroen/Projects/netlab/tests/clab_files/xr/daemons: no such file or directory

Such errors aren't critical when doing 'destroy', and shouldn't stop the process

hyposcaler-bot commented 5 days ago

Looked at this to just understand the flow for destroy.

a side effect of cmd.destroyFn() calling clab.NewContainerLab() to parse the topology is that clab.resolveBindPaths() eventually gets called.

clab.resolveBindPaths() kicks the error if os.stat() errors on the path.

hellt commented 1 day ago

yes, this needs to be addressed like a parameter to the NewContainerlab that would switch off validations. Destroy routine should set it