Failed to remove OCI runtime directory when we remove a container running with --rm option
Issue
-
When we use
podman rm/restart/stop/kill etc...command to a container running with --rm option, the OCI runtime directory remains at/run/<runtime name>(root user) or/run/user/<user id>/<runtime name>(rootless user). -
This bug can cause any bugs.
For example, failed to restore a container running with --rm option.
# podman run --rm -d --name test ubi8 sleep inf
e0d14db04523d2ad4551cb16344ae073d84fbed4c71d66236898c0114c401df0
# podman container checkpoint test --export test.tar
e0d14db04523d2ad4551cb16344ae073d84fbed4c71d66236898c0114c401df0
# podman container restore --import test.tar
e0d14db04523d2ad4551cb16344ae073d84fbed4c71d66236898c0114c401df0
# podman rm -f -t 0 test
e0d14db04523d2ad4551cb16344ae073d84fbed4c71d66236898c0114c401df0
# podman container restore --import test.tar
Error: OCI runtime error: runc: container with given ID already exists
Environment
- Red Hat Enterprise Linux 8.5 - 8.6
- Red Hat Enterprise Linux 9.0
- Podman version 3.3 - 4.1
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.