Skip to content

fix(vm): don't offer "None (skip)" after queuing storage volumes - #56

Merged
hi-lei merged 1 commit into
mainfrom
fix/vm-wizard-storage-skip
Aug 9, 2026
Merged

fix(vm): don't offer "None (skip)" after queuing storage volumes#56
hi-lei merged 1 commit into
mainfrom
fix/vm-wizard-storage-skip

Conversation

@hi-lei

@hi-lei hi-lei commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Fixes #54.

Root cause

The storage step of vm create's wizard loops to collect volumes into local vars (wizard.go), flushed to opts.VolumeSpecs/ExistingVolumes only via the Done branch. But buildStorageChoices kept None (skip) at row 0 even after the user had queued a volume — and the re-prompt rests the cursor on row 0. So one Enter on the second prompt hit the case "" branch, which nils out the opts and drops the locals: the volume never appears in the summary, is never created, never attached.

Downstream was fine: Doneopts.VolumeSpecs → summary (wizard_summary.go) → parseVolumeSpecs (create.go) all work; only the silent-discard path was broken.

Fix

None (skip) is now only offered on the fresh storage menu. Once volumes are queued the menu is add-more/Done — quitting is still possible via Esc (re-entering the step resets for a fresh pass).

Tests

  • buildStorageChoices: skip absent once a new/existing volume is queued; Done present (verified to fail on pre-fix code)
  • Loader-level: add → Done flushes VolumeSpecs; fresh skip leaves storage empty

Test plan

  • make build, make lint, package tests (pre-commit hooks incl. golangci-lint all pass)
  • Regression test verified against pre-fix code

Note

Independent of #55 (overlap is just import lines in wizard.go/wizard_subflows.go — clean merge either way). Suggest shipping this first as a patch release; dismissed volume intent is a bad silent failure in v1.7.2.

The storage wizard step keeps queued volumes in local vars, flushed to
opts only via "Done". But buildStorageChoices kept "None (skip)" at
row 0 even after the user added a volume; re-prompt rests the cursor on
row 0, so one Enter silently discarded every queued volume — nothing in
the summary, nothing created, nothing attached (fixes #54).

Skip is now only offered on the fresh storage menu; with volumes queued
the options are add-more/Done, and Esc still aborts (the loader resets
on re-entry for a fresh pass).

Regression tests: choices-level (skip absent once queued) and
loader-level (add -> Done flushes specs; fresh skip leaves storage
empty). Verified the choices test fails on the pre-fix code.
@hi-lei
hi-lei force-pushed the fix/vm-wizard-storage-skip branch from b12982a to 3a3d4d2 Compare August 9, 2026 09:36
@hi-lei
hi-lei merged commit 98c3c45 into main Aug 9, 2026
12 checks passed
@hi-lei
hi-lei deleted the fix/vm-wizard-storage-skip branch August 9, 2026 09: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.

vm create wizard: block volume added in Storage step is silently dropped, not created

1 participant