Skip to content
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

podman rm -f con1 con2 con-nonexistent not working #21529

Closed
Luap99 opened this issue Feb 6, 2024 · 3 comments · Fixed by #22259
Closed

podman rm -f con1 con2 con-nonexistent not working #21529

Luap99 opened this issue Feb 6, 2024 · 3 comments · Fixed by #22259
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@Luap99
Copy link
Member

Luap99 commented Feb 6, 2024

Issue Description

Describe your issue

Steps to reproduce the issue

Steps to reproduce the issue

  1. podman create --name t1 quay.io/libpod/testimage:20221018
  2. podman create --name t2 quay.io/libpod/testimage:20221018
  3. podman rm -f t1 t2 t3

Describe the results you received

The rm commands returns with exit code 0 and no error printed.

podman ps -a
CONTAINER ID  IMAGE                              COMMAND               CREATED        STATUS      PORTS       NAMES
bdb50262ecbd  quay.io/libpod/testimage:20221018  /bin/echo This co...  3 minutes ago  Created                 t1
3f1b3b8657fd  quay.io/libpod/testimage:20221018  /bin/echo This co...  3 minutes ago  Created                 t2

Describe the results you expected

both containers gone

podman info output

latest main

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

Yes

Additional environment details

No response

Additional information

Without -f there is a proper error report that t3 does not exists but I think t1 and t2 should still be deleted.
Error: no container with ID or name "t3" found: no such container

@Luap99 Luap99 added the kind/bug Categorizes issue or PR as related to a bug. label Feb 6, 2024
@mheon
Copy link
Member

mheon commented Feb 6, 2024

Isn't this what --ignore is for?

@Luap99
Copy link
Member Author

Luap99 commented Feb 6, 2024

Well yes -f implies --ignore but it doesn't change the fact that this command did nothing even though I gave it 2 valid containers.
I am not saying it must print an error but it must remove t1 and t2.

When you run rm file1 file2 file3 and file3 does not exists I still expect 1 and 2 to be gone.

Copy link

github-actions bot commented Mar 8, 2024

A friendly reminder that this issue had no activity for 30 days.

Luap99 added a commit to Luap99/libpod that referenced this issue Apr 4, 2024
When we remove with --force we do not return a error if the input does
not exists, however if we get more than on input we must try to remove
all and not just just NOP out and not remove anything just because one
arg did not exists.

Also make the code simpler for commands that do have the --ignore option
and just make --force imply --ignore which reduces the ugly error
handling.

Fixes containers#21529

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Luap99 added a commit to Luap99/libpod that referenced this issue Apr 4, 2024
When we remove with --force we do not return a error if the input does
not exists, however if we get more than on input we must try to remove
all and not just NOP out and not remove anything just because one arg
did not exists.

Also make the code simpler for commands that do have the --ignore option
and just make --force imply --ignore which reduces the ugly error
handling.

Fixes containers#21529

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Luap99 added a commit to Luap99/libpod that referenced this issue Apr 4, 2024
When we remove with --force we do not return a error if the input does
not exists, however if we get more than on input we must try to remove
all and not just NOP out and not remove anything just because one arg
did not exists.

Also make the code simpler for commands that do have the --ignore option
and just make --force imply --ignore which reduces the ugly error
handling.

Fixes containers#21529

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
@Luap99 Luap99 self-assigned this Apr 4, 2024
@Luap99 Luap99 removed the stale-issue label Apr 4, 2024
Luap99 added a commit to Luap99/libpod that referenced this issue Apr 4, 2024
When we remove with --force we do not return a error if the input does
not exists, however if we get more than on input we must try to remove
all and not just NOP out and not remove anything just because one arg
did not exists.

Also make the code simpler for commands that do have the --ignore option
and just make --force imply --ignore which reduces the ugly error
handling.

Fixes containers#21529

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants