Skip to content

feat(cli): instances create --volume-mode copy|mount_ro - #15

Merged
heydryft merged 1 commit into
mainfrom
feat/volume-mode-flag
Nov 8, 2026
Merged

heydryft merged 1 commit into
mainfrom
feat/volume-mode-flag

Conversation

@heydryft

@heydryft heydryft commented Nov 8, 2026

Copy link
Copy Markdown
Member

Adds --volume-mode to runcrate instances create and runcrate schedule create, so a person or an agent can ask for the API's volume_mode without calling the API by hand.

  • --volume-mode copy|mount_ro, any case. It is sent as volume_mode only when you give it; left out, the API default (copy) applies.
  • A bad value, or --volume-mode without --volume, is refused before any request is made.
  • copy: the volume is copied to the machine's disk at boot and changes are copied back. mount_ro: the volume is mounted read-only at /workspace, ready in seconds. A machine or volume that cannot mount is refused by the API with VOLUME_MODE_UNSUPPORTED; it is never turned into a copy.
  • schedule create shares the request builder, so an instance schedule takes the flag too (the schedules API passes volume_mode to the launch). A job schedule refuses it, since jobs always copy. runcrate run has no flag for the same reason.
  • The create output names the mode on the existing Volume line only when you chose one.
  • README documents the flag.

Tests: request body with and without the flag, case, invalid value, missing --volume, the whole create command against a counting fake server (no request on a refusal), schedule specs, and the API client body. go vet ./... and go test ./... pass. Smoke: built binary against a local fake API, the POST body for --volume vol-1 --volume-mode mount_ro carried "storage_id":"vol-1","volume_mode":"mount_ro".

Not merged or tagged: for review.

--volume-mode is sent as volume_mode only when given, case-insensitive, checked before any
network call, and needs --volume. schedule create takes it for an instance schedule and
refuses it on a job schedule (jobs always copy). The create output names the mode beside the
Volume line when one was chosen. README documents the flag.
@heydryft
heydryft merged commit 401a974 into main Nov 8, 2026
1 check passed
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