feat(cli): add multi lifecycle operations with label-selector and confirmation prompt#2412
Open
yaroslavborbat wants to merge 2 commits into
Open
feat(cli): add multi lifecycle operations with label-selector and confirmation prompt#2412yaroslavborbat wants to merge 2 commits into
yaroslavborbat wants to merge 2 commits into
Conversation
Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
813fff2 to
0f54051
Compare
…ting Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
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.
Description
Add support for multi-target lifecycle operations, label-selector targeting, and confirmation prompts in the CLI (
d8v).start,stop,restart,evict,migrate) now accept multiple VM names as arguments.--allflag applies the operation to all VMs in the current namespace.--label-selector/-lflag filters target VMs by label set (e.g.--label-selector env=prod,tier=frontend).--yes/-yflag skips interactive confirmation; without it, each VM requires explicity/yesconfirmation before the action is executed.--alland--label-selectorare mutually exclusive; both are incompatible with positional VM name arguments.--create-onlyis implicitly forced to prevent blocking on each individual operation.Why do we need it, and what problem does it solve?
Previously, lifecycle commands only accepted a single VM name, requiring users to run the command repeatedly for each VM.
This is inconvenient in scenarios like draining a node, performing maintenance, or bulk-testing VM lifecycle behaviour.
The
--allflag and multi-argument support eliminate the need for shell loops.The
--label-selectorflag allows targeting a logical group of VMs without listing each one explicitly.The confirmation prompt prevents accidental bulk operations, while
--yeskeeps scripting ergonomic.What is the expected result?
d8v stop vm1 vm2 vm3— all three VMs are stopped (with per-VM confirmation).d8v restart --all --yes— all VMs in the current namespace are restarted without prompting.d8v stop --label-selector env=prod— stops all VMs matching the label, with per-VM confirmation.d8v start --all vm1— command returns an error: cannot use--allwith specific keys.d8v start --all --label-selector env=prod— command returns an error: cannot use both flags together.Checklist
Changelog entries