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

Update docs/command output for volume prune to specify when named volumes will be deleted #4079

Closed
wants to merge 2 commits into from

Conversation

dwminer
Copy link

@dwminer dwminer commented Mar 9, 2023

In previous versions of the Docker API, system prune --volumes and volume prune would remove all dangling volumes. With API v1.42, this was changed so that only anonymous volumes would be removed unless the all filter was specified. Update the docs and command output to reflect this.

Fixes #4028

- What I did
Updated documentation/warning output for the system_prune and volume_prune commands to reflect that only anonymous volumes are removed by default.
- How I did it

  • Updated doc files
  • In volume/prune.go, specify that anonymous volumes will be removed. If all=1 is set, indicate that named volumes will be removed too.

- How to verify it
docker volume prune
docker volume prune --filter all=1

- Description for the changelog
Update volume prune output to be more specific about whether named volumes will be removed.

- A picture of a cute animal (not mandatory but encouraged)

image

In previous versions of the Docker API, `system prune --volumes` and
`volume prune` would remove all dangling volumes. With API v1.42, this
was changed so that only anonymous volumes would be removed unless the
`all` filter was specified. Update the docs to reflect this.

Signed-off-by: Dalton Miner <[email protected]>
Currently, the output of the `volume prune` command is potentially confusing,
because only anonymous dangling volumes are removed by default. Update
help text and warning output accordingly.

Signed-off-by: Dalton <[email protected]>
@dwminer dwminer requested a review from thaJeztah as a code owner March 9, 2023 07:02
@dwminer
Copy link
Author

dwminer commented Apr 18, 2023

@thaJeztah Any chance you could look at this? I think it would alleviate a lot of the pain that I and other people commenting in #4028 experienced updating the docs to be more clear about what should happen.

@cpuguy83
Copy link
Collaborator

Update LGTM but there's some conflicts, likely because some of the changes were merged as part of #4218


Total reclaimed space: 36 B

$ docker volume prune --filter all=1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably showcase the new -a flag here instead.

@edmorley
Copy link
Contributor

edmorley commented Jul 6, 2023

I ran into #4028 because of the currently misleading docs/CLI output. As such, it would be great to have this land :-)

I presume the one remaining review comment + resolving the conflicts are the only blockers?

@edmorley
Copy link
Contributor

edmorley commented Aug 4, 2023

@dwminer Hi! Do you know if you might get a chance to resolve the conflicts here and make that -a change? If not I could open a new PR instead - but wanted to check with you first :-)

edmorley added a commit to edmorley/docker-cli that referenced this pull request Aug 12, 2023
In previous versions of the Docker API, `system prune --volumes` and `volume prune`
would remove all dangling volumes. With API v1.42, this was changed so that only
anonymous volumes would be removed unless the all filter was specified.

Some of the docs were updated in docker#4218, however, there were a couple of places
left that didn't make the anonymous vs named volumes distinction clear.

This replaces docker#4079, which was bitrotted by docker#4218.

See also docker#4028.

Signed-off-by: Ed Morley <[email protected]>
edmorley added a commit to edmorley/docker-cli that referenced this pull request Aug 12, 2023
In previous versions of the Docker API, `system prune --volumes` and `volume prune`
would remove all dangling volumes. With API v1.42, this was changed so that only
anonymous volumes would be removed unless the all filter was specified.

Some of the docs were updated in docker#4218, however, there were a couple of places
left that didn't make the anonymous vs named volumes distinction clear.

This replaces docker#4079, which was bitrotted by docker#4218. See also docker#4028.

Closes docker#4079.

Signed-off-by: Ed Morley <[email protected]>
@edmorley
Copy link
Contributor

So looking into the conflicts in this PR, I found that #4218 improved some of the docs here already, but that there are a few places remaining to be updated.

As such, I've opened #4497 for those few leftovers, which replaces this PR.

thaJeztah pushed a commit to thaJeztah/cli that referenced this pull request Aug 25, 2023
In previous versions of the Docker API, `system prune --volumes` and `volume prune`
would remove all dangling volumes. With API v1.42, this was changed so that only
anonymous volumes would be removed unless the all filter was specified.

Some of the docs were updated in docker#4218, however, there were a couple of places
left that didn't make the anonymous vs named volumes distinction clear.

This replaces docker#4079, which was bitrotted by docker#4218. See also docker#4028.

Closes docker#4079.

Signed-off-by: Ed Morley <[email protected]>
(cherry picked from commit 6e2e92d)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
@dwminer
Copy link
Author

dwminer commented Aug 25, 2023

Thanks for the follow-up and replacement PR @edmorley; life happened and I never found the time to return to this. 🙂

@edmorley
Copy link
Contributor

No problem! Thank you for opening this PR which saved me a fair bit of time understanding where would need updating :-)

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.

volumes wont be deleted since update to docker 23
5 participants