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

cli: add --all-inactive for rm command #885

Merged
merged 1 commit into from
Feb 4, 2022

Conversation

crazy-max
Copy link
Member

fixes #851

Add --inactive to be able to remove nodes that are not in running state. This will also remove builders that don't have any node left available after the process.

Signed-off-by: CrazyMax [email protected]

commands/rm.go Outdated Show resolved Hide resolved
commands/rm.go Outdated Show resolved Hide resolved
commands/rm.go Outdated
@@ -72,6 +90,7 @@ func rmCmd(dockerCli command.Cli, rootOpts *rootOptions) *cobra.Command {
flags := cmd.Flags()
flags.BoolVar(&options.keepState, "keep-state", false, "Keep BuildKit state")
flags.BoolVar(&options.keepDaemon, "keep-daemon", false, "Keep the buildkitd daemon running")
flags.BoolVar(&options.inactive, "inactive", false, "Remove inactive builders")
Copy link
Member

Choose a reason for hiding this comment

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

I prefer all-inactive that makes it clear that this is a different mode

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree but more generally I think the CLI has a confusing design for some commands. For example the following would make more sense:

  • docker buildx du > docker buildx cache du
  • docker buildx prune > docker buildx cache prune
  • docker buildx rm --all-inactive > docker buildx prune

Copy link
Member

Choose a reason for hiding this comment

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

Using prune for something other than build cache is quite confusing imho. Especially because it means completely different thing atm. For the possibility of cache subcommand we can discuss in another issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

Using prune for something other than build cache is quite confusing imho.

Yes can be confusing.

For the possibility of cache subcommand we can discuss in another issue.

👍

commands/rm.go Outdated Show resolved Hide resolved
@crazy-max crazy-max changed the title cli: add --inactive for rm command cli: add --all-inactive for rm command Dec 17, 2021
@crazy-max crazy-max marked this pull request as ready for review December 17, 2021 15:06
@crazy-max
Copy link
Member Author

PTAL @tonistiigi @errordeveloper

@crazy-max crazy-max added this to the v0.8.0 milestone Jan 26, 2022
commands/rm.go Outdated Show resolved Hide resolved
commands/rm.go Outdated Show resolved Hide resolved
commands/rm.go Outdated Show resolved Hide resolved
@tonistiigi tonistiigi merged commit 5952857 into docker:master Feb 4, 2022
@crazy-max crazy-max deleted the rm-inactive branch February 4, 2022 10:19
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.

add buildx rm --all-inactive
3 participants