-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Force removing image with 2 tags and running container does not remove the container #7153
Labels
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
Comments
openshift-ci-robot
added
the
kind/bug
Categorizes issue or PR as related to a bug.
label
Jul 30, 2020
Reproduces. The container has definitely been removed from storage as part of the removal of the image, so the inconsistency seems to be that we removed it directly from c/storage and not via Podman's removal functions. |
Think I found it. Simple logic error wasn't invoking container delete, so the c/storage code kicked in. |
Fix in #7155 |
mheon
added a commit
to mheon/libpod
that referenced
this issue
Jul 30, 2020
The logic for `podman rmi --force` includes a bit of code that will remove Libpod containers using Libpod's container removal logic - this ensures that they're cleanly and completely removed. For other containers (Buildah, CRI-O, etc) we fall back to manually removing the containers using the image from c/storage. Unfortunately, our logic for invoking the Podman removal function had an error, and it did not properly handle cases where we were force-removing an image with >1 name. Force-removing such images by ID guarantees their removal, not just an untag of a single name; our code for identifying whether to remove containers did not proper detect this case, so we fell through and deleted the Podman containers as storage containers, leaving traces of them in the Libpod DB. Fixes containers#7153 Signed-off-by: Matthew Heon <[email protected]>
mheon
added a commit
to mheon/libpod
that referenced
this issue
Jul 31, 2020
The logic for `podman rmi --force` includes a bit of code that will remove Libpod containers using Libpod's container removal logic - this ensures that they're cleanly and completely removed. For other containers (Buildah, CRI-O, etc) we fall back to manually removing the containers using the image from c/storage. Unfortunately, our logic for invoking the Podman removal function had an error, and it did not properly handle cases where we were force-removing an image with >1 name. Force-removing such images by ID guarantees their removal, not just an untag of a single name; our code for identifying whether to remove containers did not proper detect this case, so we fell through and deleted the Podman containers as storage containers, leaving traces of them in the Libpod DB. Fixes containers#7153 Signed-off-by: Matthew Heon <[email protected]>
github-actions
bot
added
the
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
label
Sep 23, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Force removing image with 2 tags and running container does not remove the container.
I created simple script, see below. The first
rmi
call fails, calling it again succeeds, removes both images but keeps the container running. The container cannot be theninspect
ed norattach
ed to, but is still shown as running.If I don't tag the container (removing the third line in the script) the first removal succeeds and all is as expected.
Steps to reproduce the issue:
Describe the results you received:
Container is still running even though its image is not present.
Describe the results you expected:
Container would be deleted the same way it gets deleted when the image has only one tag.
Output of
podman version
:NOTE:
I noticed this when I was force deleting through APIv2. There it should behave the same.
The text was updated successfully, but these errors were encountered: