Skip to content

feat(cli): add multi lifecycle operations with label-selector and confirmation prompt#2412

Open
yaroslavborbat wants to merge 2 commits into
mainfrom
feat/cli/multi-lifecycle-operations
Open

feat(cli): add multi lifecycle operations with label-selector and confirmation prompt#2412
yaroslavborbat wants to merge 2 commits into
mainfrom
feat/cli/multi-lifecycle-operations

Conversation

@yaroslavborbat
Copy link
Copy Markdown
Member

@yaroslavborbat yaroslavborbat commented May 28, 2026

Description

Add support for multi-target lifecycle operations, label-selector targeting, and confirmation prompts in the CLI (d8v).

  • Lifecycle commands (start, stop, restart, evict, migrate) now accept multiple VM names as arguments.
  • New --all flag applies the operation to all VMs in the current namespace.
  • New --label-selector / -l flag filters target VMs by label set (e.g. --label-selector env=prod,tier=frontend).
  • New --yes / -y flag skips interactive confirmation; without it, each VM requires explicit y/yes confirmation before the action is executed.
  • --all and --label-selector are mutually exclusive; both are incompatible with positional VM name arguments.
  • When operating on multiple VMs, --create-only is implicitly forced to prevent blocking on each individual operation.
  • Errors and messages per VM are printed inline instead of aborting the whole batch.

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 --all flag and multi-argument support eliminate the need for shell loops.
The --label-selector flag allows targeting a logical group of VMs without listing each one explicitly.
The confirmation prompt prevents accidental bulk operations, while --yes keeps scripting ergonomic.

What is the expected result?

  1. Run d8v stop vm1 vm2 vm3 — all three VMs are stopped (with per-VM confirmation).
  2. Run d8v restart --all --yes — all VMs in the current namespace are restarted without prompting.
  3. Run d8v stop --label-selector env=prod — stops all VMs matching the label, with per-VM confirmation.
  4. Run d8v start --all vm1 — command returns an error: cannot use --all with specific keys.
  5. Run d8v start --all --label-selector env=prod — command returns an error: cannot use both flags together.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: core
type: feature
summary: "CLI lifecycle commands (start, stop, restart, evict, migrate) now support multiple VM targets, --all flag, --label-selector flag for label-based targeting, and --yes flag for non-interactive confirmation."

@yaroslavborbat yaroslavborbat requested a review from Isteb4k as a code owner May 28, 2026 13:22
@yaroslavborbat yaroslavborbat added this to the v1.9.0 milestone May 28, 2026
Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
@yaroslavborbat yaroslavborbat force-pushed the feat/cli/multi-lifecycle-operations branch from 813fff2 to 0f54051 Compare May 28, 2026 14:24
…ting

Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
@yaroslavborbat yaroslavborbat changed the title feat(cli): add multi lifecycle operations feat(cli): add multi lifecycle operations with label-selector and confirmation prompt May 28, 2026
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.

1 participant