c8d: implement missing image delete logic#45427
Merged
thaJeztah merged 1 commit intomoby:masterfrom May 10, 2023
Merged
Conversation
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.
- Related
--no-prune) option for image delete #43849- What I did
Ports over all the previous image delete logic, such as:
pruneandforceflagsdelete the passed reference
by a running container, throw an error if !force, or delete the reference and create
a dangling reference otherwise
delete anyway if force
pruneis true, and the image being deleted has dangling parents, remove themAlso implements logic to get image parents in c8d by comparing shared layers, like what @vvoland did in #45265, so that we can prune dangling parents on image delete.
- How I did it
With neovim! 👀
- How to verify it
Pull and delete a ton of different images, tag them and use them and try to delete them 😅
Compare the results, and see if they make sense.
Some examples from me:
(complains if it's the only reference and a container is using it, allows deleting if there is another reference, forcing leaves dangling image)
(complains if image referenced in multiple repos, removes all and deletes with force)
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)