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

Added confirmation when removing volumes #1437 #1465

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

grallc
Copy link

@grallc grallc commented Oct 21, 2018

- What I did
Confirmation is now required for deleting a volume with docker volume rm. (#1437)
It will ask a confirmation for each volumes.

- How I did it
Simply added a condition in /cli/command/volume/remove.go.

- How to verify it
Create some volumes with docker volume create [name] (eg. docker volume create dog-volume, docker volume create cat-volume, docker volume create rabbit-volume) then delete them with docker volume rm (docker volume rm cat-volume dog-volume).

- A picture of a cute animal
image

@GordonTheTurtle
Copy link

Please sign your commits following these rules:
https://github.com/moby/moby/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ git clone -b "delete-confirmation-1437" git@github.com:grallc/cli.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -f

Amending updates the existing PR. You DO NOT need to open a new one.

Signed-off-by: Corentin Grall <corentin.grall@gmail.com>
@thaJeztah
Copy link
Member

We can't change the default behavior, because it will likely break many people. I do see the value of having some kind of "interactive" version of docker volume rm, but if we want that, we should think of making this configurable ( in the cli configuration file ~/.docker/config.json).

So in its current form, I don't think we can make this change, but we can discuss options here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants