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

Add builder prune --all and --force flag support #3316

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

austinvazquez
Copy link
Member

@austinvazquez austinvazquez commented Aug 15, 2024

Description

This change adds support for builder prune --all and --force. A refactor
of previous tests which used builder prune functionality was required to
handle the new confirmation prompt. A test utility was added to handle
this for reuse by current and future tests.

Testing

From containerd/nerdctl:

nerdctl builder build .
nerdctl builder prune --all --force

Next steps

  1. Test assertions are weak without a builder du implementation

@austinvazquez austinvazquez marked this pull request as ready for review August 15, 2024 16:26
msg string
)

if !options.All {
Copy link
Contributor

@pendo324 pendo324 Aug 15, 2024

Choose a reason for hiding this comment

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

nit: might be slightly easier to read if you reverse this conditional, since we need to handle both cases anyway

This change adds support for builder prune --all and --force. A refactor
of previous tests which used builder prune functionality was required to
handle the new confirmation prompt. A test utility was added to handle
this for reuse by current and future tests.

Signed-off-by: Austin Vazquez <[email protected]>
@AkihiroSuda AkihiroSuda added this to the v2.0.0 milestone Aug 16, 2024
@@ -82,4 +82,6 @@ type BuilderPruneOptions struct {
BuildKitHost string
// All will remove all unused images and all build cache, not just dangling ones
All bool
// Force will not prompt for confirmation.
Force bool
Copy link
Member

Choose a reason for hiding this comment

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

Where is this consumed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like it ended up being used on the CLI side only, so not much reason to pass it to the package backend.

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

@AkihiroSuda AkihiroSuda merged commit eb808f1 into containerd:main Aug 16, 2024
19 checks passed
@austinvazquez austinvazquez deleted the add-builder-prune-all branch August 16, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants