-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
rm: set exit code to 1 if a specified container is not found #2540
rm: set exit code to 1 if a specified container is not found #2540
Conversation
Closes: containers#2539 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giuseppe 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 already have this? podman rm foobar |
Ok I looked at the issue and it looks like I missed this use case. |
@@ -80,6 +80,9 @@ func rmCmd(c *cliconfig.RmValues) error { | |||
return err | |||
} | |||
if err != nil { | |||
if errors.Cause(err) == libpod.ErrNoSuchCtr { | |||
exitCode = 1 | |||
} | |||
fmt.Println(err.Error()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just wondering if we should error out at this point and not try the deletions? If it's OK to continue on and delete what we can, then LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we document that we return 1 if a container is not found
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the desired behaviour is to keep going and output at the end.
/lgtm |
@@ -80,6 +80,9 @@ func rmCmd(c *cliconfig.RmValues) error { | |||
return err | |||
} | |||
if err != nil { | |||
if errors.Cause(err) == libpod.ErrNoSuchCtr { | |||
exitCode = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closes: #2539
Signed-off-by: Giuseppe Scrivano gscrivan@redhat.com