Repository navigation
feat(cli): instances create --volume-mode copy|mount_ro - #15
Merged
Merged
Conversation
--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.
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.
Adds
--volume-modetoruncrate instances createandruncrate schedule create, so a person or an agent can ask for the API'svolume_modewithout calling the API by hand.--volume-mode copy|mount_ro, any case. It is sent asvolume_modeonly when you give it; left out, the API default (copy) applies.--volume-modewithout--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 withVOLUME_MODE_UNSUPPORTED; it is never turned into a copy.schedule createshares the request builder, so an instance schedule takes the flag too (the schedules API passesvolume_modeto the launch). A job schedule refuses it, since jobs always copy.runcrate runhas no flag for the same reason.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 ./...andgo test ./...pass. Smoke: built binary against a local fake API, the POST body for--volume vol-1 --volume-mode mount_rocarried"storage_id":"vol-1","volume_mode":"mount_ro".Not merged or tagged: for review.