-
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
Confirmation prompt for 'container prune' breaks non-interactive use #4844
Comments
Wait, container prune --force prunes running? That sounds like a bug.
…On Sat, Jan 11, 2020, 13:49 StefanBruens ***@***.***> wrote:
/kind bug
*Description*
With podman 1.7.0, it is no longer possible to prune containers from a
script.
The prompt can be avoided by adding --force, but this will also prune
running containers.
Please add a --yes/-y flag to allow confirmation from a script.
*Steps to reproduce the issue:*
podman container prune && echo "OK"
*Describe the results you received:*
WARNING! This will remove all stopped containers.
Are you sure you want to continue? [y/N]
*Describe the results you expected:*
OK
*Output of podman version:*
1.7.0
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#4844>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3AOCBB6XXY67R6T3UF3MTQ5IICVANCNFSM4KFTNDTQ>
.
|
It's possible the description there may be inaccurate. |
@mheon @StefanBruens this just tripped me up as well while i was working on the apiv2 stuff so i had to look at the code as well. it turns out the description is incorrect. the force should only be used to skip the interactive bit. however, it IS passed onto the container removal call. that said, we are safe here because prune uses container filters to select which containers to prune. therefore the force is basically a no-op. i'll see about a quick pr to tidy this up. |
the --force parameter should only be used for the CLI and should only dictate whether to prompt the user for confirmation. Fixes: containers#4844 Signed-off-by: baude <[email protected]>
/kind bug
Description
With podman 1.7.0, it is no longer possible to prune containers from a script.
The prompt can be avoided by adding
--force
, but this will also prune running containers.Please add a
--yes
/-y
flag to allow confirmation from a script.The prompt was added here:
0602ce4
Steps to reproduce the issue:
podman container prune && echo "OK"
Describe the results you received:
Describe the results you expected:
OK
Output of
podman version
:1.7.0
The text was updated successfully, but these errors were encountered: