-
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
[v5.2-rhel] Fix podman stop
and podman run --rmi
#24197
[v5.2-rhel] Fix podman stop
and podman run --rmi
#24197
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: TomSweeneyRedHat The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Ephemeral COPR build failed. @containers/packit-build please check. |
Could you add a reference to the commit that this is a backport of 458ba5a? Have you used |
I did do a |
f747586
to
c0a1fc0
Compare
This started off as an attempt to make `podman stop` on a container started with `--rm` actually remove the container, instead of just cleaning it up and waiting for the cleanup process to finish the removal. In the process, I realized that `podman run --rmi` was rather broken. It was only done as part of the Podman CLI, not the cleanup process (meaning it only worked with attached containers) and the way it was wired meant that I was fairly confident that it wouldn't work if I did a `podman stop` on an attached container run with `--rmi`. I rewired it to use the same mechanism that `podman run --rm` uses, so it should be a lot more durable now, and I also wired it into `podman inspect` so you can tell that a container will remove its image. Tests have been added for the changes to `podman run --rmi`. No tests for `stop` on a `run --rm` container as that would be racy. Fixes containers#22852 Fixes RHEL-39513 For this branch Backport of: [458ba5a](containers@458ba5a) Fixes: https://issues.redhat.com/browse/RHEL-61667 Signed-off-by: Matt Heon <mheon@redhat.com> Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
c0a1fc0
to
a5766aa
Compare
@edsantiago or @mheon
|
It's only on remote. My first suspicion was that there's another commit missing, and 80639df looked like a possible candidate, but I can't cherrypick it and am running into diminishing returns. |
8e78028 silences the warning. I don't know if that's the right solution, but it's good enough for me. |
Since commit 458ba5a the cleanup process now removes the image as well, thus the removal is racy and it will cause an error here. The code tried to ignore the error with errors.Is() but this never works across the remote API. However the API already has a ignore option so juts use that and fix the error message so that we can easily find the root cause and I do not have to guess where the log was written. Fixes containers#23719 Signed-off-by: Paul Holzinger <pholzing@redhat.com> (cherry picked from commit 8e78028) Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
Thx @edsantiago , I've added that commit and 🤞 |
Great Call @edsantiago ! Happy green test buttons. This is for a RHEL 9.5 ZeroDay fix, can I get a few eyeballs on this please? |
/lgtm |
c03b5f3
into
containers:v5.2-rhel
This started off as an attempt to make
podman stop
on a container started with--rm
actually remove the container, instead of just cleaning it up and waiting for the cleanup process to finish the removal.In the process, I realized that
podman run --rmi
was rather broken. It was only done as part of the Podman CLI, not the cleanup process (meaning it only worked with attached containers) and the way it was wired meant that I was fairly confident that it wouldn't work if I did apodman stop
on an attached container run with--rmi
. I rewired it to use the same mechanism thatpodman run --rm
uses, so it should be a lot more durable now, and I also wired it intopodman inspect
so you can tell that a container will remove its image.Tests have been added for the changes to
podman run --rmi
. No tests forstop
on arun --rm
container as that would be racy.Fixes #22852
Fixes RHEL-39513
For this branch
Backport of: 458ba5a
Fixes: https://issues.redhat.com/browse/RHEL-61667
Does this PR introduce a user-facing change?