-
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
remote: fix invalid --cidfile + --ignore #23581
Conversation
@edsantiago PTAL |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Luap99 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 |
We were not able to find or create Copr project
Unless the HTTP status code above is >= 500, please check your configuration for:
|
LGTM but I'm still seeing the error when I test on my laptop? $ hack/bats -T --rootless --remote --tag='ci:parallel' 050
--------------------------------------------------
$ bats -T --jobs 12 --filter-tags ci:parallel test/system/050-stop.bats
050-stop.bats
✓ |050| podman stop - basic test [10566]
✗ |050| podman stop --ignore [10459]
tags: ci:parallel
(from function `bail-now' in file test/system/helpers.bash, line 189,
from function `is' in file test/system/helpers.bash, line 1103,
in test file test/system/050-stop.bats, line 116)
`is "$output" "" "podman stop with missing cidfile, with --ignore"' failed
[07:47:15.908604373] $ bin/podman-remote stop thiscontainerdoesnotexist
[07:47:15.934666476] Error: no container with name or ID "thiscontainerdoesnotexist" found: no such container
[07:47:15.938368935] [ rc=125 (expected) ]
[07:47:15.949413567] $ bin/podman-remote stop --ignore thiscontainerdoesnotexist
[07:47:16.061030284] $ bin/podman-remote stop --cidfile=/dev/shm/podman_bats.pek5UO/no-such-file
[07:47:16.085520773] Error: reading CIDFile: open /dev/shm/podman_bats.pek5UO/no-such-file: no such file or directory
[07:47:16.088495150] [ rc=125 (expected) ]
[07:47:16.096670405] $ bin/podman-remote stop --cidfile=/dev/shm/podman_bats.pek5UO/no-such-file --ignore
[07:47:26.230647320] e681e1eea6d7de67773a067763c57ae2bc2e9f32d27a0e032cd5e071741fe96e
fa0078372cc6be516d186a4c4f3050206555c00bc895712ca2263249219d40e5
a0cbb322f6167b28159f520ea1e201341136b2b54305f6cd5c4ddad761298d08
369a88fece6af6fd78e7989a235292a5c5845e79d0d70258f55da443f43a835d
#/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
#| FAIL: podman stop with missing cidfile, with --ignore
#| expected: '[no output]'
#| actual: 'e681e1eea6d7de67773a067763c57ae2bc2e9f32d27a0e032cd5e071741fe96e'
#| > 'fa0078372cc6be516d186a4c4f3050206555c00bc895712ca2263249219d40e5'
#| > 'a0cbb322f6167b28159f520ea1e201341136b2b54305f6cd5c4ddad761298d08'
#| > '369a88fece6af6fd78e7989a235292a5c5845e79d0d70258f55da443f43a835d'
#\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# [teardown]
✓ |050| podman stop - can trap signal [4178] |
@edsantiago Did you pick b8039a0? I don't see in your parallel PR: https://github.com/containers/podman/pull/23275/commits The second commit fixes a minor issue that is causing the no such container error but the first commit is the important one so we do not stop all containers in that case. |
Argh. I missed that this was two commits. I'm sorry; too much at once. With both commits cherrypicked, tests pass, and I've pushed that. |
Looks like a regression in filters:
|
Yeah no idea why we even allow that, names and filters at the same time? |
I see value in filter + [list of container names] |
When the cidfile does not exists and ignore is set the cli parser skips the file without error and we call into the backend code without any names at all. This should logically be a NOP but on remote it caused all containers to be returned which caused podman stop to stop everything in this case. Fixes containers#23554 Signed-off-by: Paul Holzinger <[email protected]>
When the client gets a 404 back we know the container does not exists, if ignore is set as well we should just ignore the error client side. seen in containers#23554 Signed-off-by: Paul Holzinger <[email protected]>
Fixed the code, a bit more checks but now we at at skip the unnecessary list API call for that case. |
Passing in #23275 and in my own testing. LGTM, thank you |
/lgtm |
When the cidfile does not exists and ignore is set the cli parser skips
the file without error and we call into the backend code without any
names at all. This should logically be a NOP but on remote it caused all
containers to be returned which caused podman stop to stop everything in
this case.
Fixes #23554
pkg/bindings/containers: handle ignore for stop
When the client gets a 404 back we know the container does not exists,
if ignore is set as well we should just ignore the error client side.
seen in #23554
Does this PR introduce a user-facing change?