Skip to content

fix: resume volume rebuild and confirm clone volume reuse - #55

Merged
wcgomes merged 3 commits into
mainfrom
patch/volume-resume-clone-reuse
Oct 2, 2026
Merged

wcgomes merged 3 commits into
mainfrom
patch/volume-resume-clone-reuse

Conversation

@wcgomes

@wcgomes wcgomes commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

Volume-mode rebuild can resume after the old container is deleted even when no recovery helper exists. Clone no longer deletes an existing workspace volume unless the operator chooses replace.

  • Before delete, VolumeRecoveryResume publishes an identity-only name index. rebuild --name loads it on containerNotFound, reuses the stamped *-ws volume, and refuses to create a blank one if that volume is missing. A listed marked helper still wins.
  • TTY clone prompts Workspace volume <name> already exists. Reuse it? [Y/n] (empty/Y reuses; n/no replaces; EOF aborts and does not delete). --reuse-volume and --replace-volume choose without prompting and cannot be combined. Non-TTY and --json fail closed and do not delete unless a flag is set.
  • Reuse keeps the tree and does not git-clone over existing entries (lost+found alone is empty). A reused volume is never deleted, including on later failure. Replace is the previous delete-then-create.
  • Docs: Apple named-volume volume.img is raw ext4 and can be e2fsck'd in place only while unmounted. Structure needs cleaning on chown is ext4 EUCLEAN, not a chown-logic bug.

Test plan

  • swift run adevcontainerTests — 1161 passed, 0 failed, 5 skipped
  • TTY re-clone of an existing *-ws volume prompts Reuse it? [Y/n] and does not delete on empty/Y or EOF; n replaces
  • Non-TTY / --json re-clone without --reuse-volume or --replace-volume fails closed and does not delete
  • rebuild --name after the old volume-mode container is gone and no helper exists resumes the published session and reuses the stamped *-ws (does not create a blank workspace volume)
  • CI on this PR

Volume-mode rebuild publishes a name index before delete and resumes
when the container is gone and no helper exists. Clone prompts before
deleting an existing workspace volume and does not clone over a kept tree.
Named-volume volume.img is raw ext4 and can be e2fsck'd in place only
while unmounted. Structure needs cleaning on chown is EUCLEAN, not a
chown-logic bug.
Those three verbs shared one cell, so their flags were not readable.
Each command now has its own row.
@wcgomes
wcgomes merged commit bf8b293 into main Oct 2, 2026
1 check passed
@wcgomes
wcgomes deleted the patch/volume-resume-clone-reuse branch October 2, 2026 00:45
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