api: DownOptions.Images becomes a typed ImagePruneMode, validated upfront - #14149
Open
ndeloof wants to merge 1 commit into
Open
api: DownOptions.Images becomes a typed ImagePruneMode, validated upfront#14149ndeloof wants to merge 1 commit into
ndeloof wants to merge 1 commit into
Conversation
…ront The legal values of DownOptions.Images lived in pkg/compose (image_pruner.go) while the field itself was a bare string in pkg/api, and the only validation fired inside ImagesToPrune — after down had already removed the project's containers, leaving the teardown half done on a typo. The CLI validated its --rmi flag separately, so only SDK callers were exposed. ImagePruneMode and its three values now live in pkg/api next to the field they constrain (type-aliased in pkg/compose for existing consumers), down() rejects any other value before touching a single resource, and the CLI check reuses the same definition. A unit test runs Down with expectation-free mocks: one daemon call would fail it. Epic docker#14074, B.6. Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
39 tasks
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Epic #14074, B.6. The legal values of
DownOptions.Imageslived inpkg/composewhile the field was a bare string inpkg/api, and the only validation fired insideImagesToPrune— afterdownhad already removed the project's containers, leaving the teardown half done on a typo (SDK callers only; the CLI validated its--rmiflag separately).ImagePruneModeand its three values move topkg/api, next to the field they constrain (type-aliased inpkg/composefor existing consumers — untyped string literals still compile);down()rejects any other value before touching a single resource;--rmicheck reuses the same definition;Downwith expectation-free mocks: one daemon call would fail it. Mocks verified in sync (make mocks, no drift).🤖 Generated with Claude Code