srl-labs / containerlab

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

Podman: ERRO[0010] error while trying to remove a mgmt network "clab" has associated containers with it #2294

Open mglantz opened 3 days ago

mglantz commented 3 days ago

I'm using podman and when I'm using destroy, the mgmt network fails to get removed. Containers were all removed. Second time the command runs, there is no error message, even though the network is still there, I assume as it just calls it quits after seeing that no containers are there.

First time I run the destroy command:

$ sudo containerlab -r podman destroy -t lab1.yml
INFO[0000] Parsing & checking topology file: lab1.yml   
INFO[0000] Parsing & checking topology file: lab1.yml   
INFO[0000] Destroying lab: lab1                         
INFO[0010] Removing containerlab host entries from /etc/hosts file 
INFO[0010] Removing ssh config for containerlab nodes   
ERRO[0010] error while trying to remove a mgmt network "clab" has associated containers with it. Use -f to forcibly delete containers and pods: network is being used 

Podman output, showing that the mgmt network is still there

$ sudo podman network list
NETWORK ID    NAME        DRIVER
f78fe0e84430  clab        bridge
2f259bab93aa  podman      bridge

Second time it runs, I get:

$ sudo containerlab -r podman destroy -t lab1.yml
INFO[0000] Parsing & checking topology file: lab1.yml   
INFO[0000] no containerlab containers found             

When I delete the network manually, using sudo podman network rm that works without issues.

hellt commented 3 days ago

there is currently no bandwidth to allocate to podman support/dev...

mglantz commented 3 days ago

Is there a guide on how to contribute / test development @hellt ? I had a look at the podman.go and have some theories I could test.

hellt commented 3 days ago

It is a free valley at this moment.

make build will build from your local workspace

Testing is lightly documented here https://containerlab.dev/manual/dev/test/