Prune the volumes nobody named, and the rest only when asked - #2176
Closed
MayCXC wants to merge 1 commit into
Closed
Prune the volumes nobody named, and the rest only when asked#2176MayCXC wants to merge 1 commit into
MayCXC wants to merge 1 commit into
Conversation
A volume mounted without a name is created because a container mounts it, and is of no use to anyone once nothing mounts it. A volume someone named is theirs, and one that nothing mounts yet is still theirs to mount later, so removing it because nothing mounts it takes away something they asked for and did not ask to lose. Prune takes the anonymous ones, and the named ones only when asked for all of them. That is what pruning images does here already: dangling by default, and every unused image when asked for all of them. Volumes carry the label that tells them apart from the moment one is created without a name, so nothing new is recorded to do it. Pruning containers and networks needs none of this. Every network is named when it is made and every stopped container was asked for by name, so neither has a kind that nobody asked for. The serial suite asks for all of them where it means an unused volume it named, and a new case covers the split itself: an anonymous volume goes, the named one beside it stays, and asking for all takes that one too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Motivation and Context
Closes #2169.
A volume mounted without a name is created because a container mounts it, and is of no use to anyone once nothing mounts it. A volume someone named is theirs, and one that nothing mounts yet is still theirs to mount later, so removing it because nothing mounts it takes away something they asked for and did not ask to lose.
Prune takes the anonymous ones, and the named ones only when asked for all of them. That is what pruning images does here already: dangling by default, and every unused image when asked for all of them. Volumes carry the label that tells them apart from the moment one is created without a name, so nothing new is recorded to do it.
Pruning containers and networks needs none of this. Every network is named when it is made and every stopped container was asked for by name, so neither has a kind that nobody asked for.
Marked breaking because
container volume prunewith no flags removes strictly less than it did: an unused named volume now survives until--all.Testing
The serial suite asks for all of them where it means an unused volume it named, and a new case covers the split itself: an anonymous volume goes, the named one beside it stays, and asking for all takes that one too.
Integration suite: 397 passed. Unit suite: 772 passed.
make fmt,make checkclean.