Repository navigation
cmd: accept multi-value volume options and labels - #97
Draft
f-sommerauer wants to merge 1 commit into
Draft
f-sommerauer wants to merge 1 commit into
f-sommerauer wants to merge 1 commit into
Conversation
`volume create -o` and `-l` were string slice flags, which split every value on commas, and each item was then split on "=" with parts[1] read unchecked. `-o options=rbind,rslave,ro` was split into "options=rbind", "rslave" and "ro", and the CLI panicked with an index out of range on "rslave". Mount options such as uid=1000 were turned into separate keys, and an entry without "=" (e.g. `-l foo`) also panicked. - Use string array flags: each -o/-l is one key=value entry, repeat the flag for multiple entries (same as `docker volume create -o`). - Split each entry at the first "=" only, so values may contain "," and "=". - Return an error for entries without "=" or with an empty key instead of panicking. Behaviour change: several entries in one flag (`-o k1=v1,k2=v2`, the form the old help text documented) are no longer split; repeat the flag instead (`-o k1=v1 -o k2=v2`), which already worked before.
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.
volume create -oand-lwere string slice flags, which split everyvalue on commas, and each item was then split on "=" with parts[1] read
unchecked.
-o options=rbind,rslave,rowas split into "options=rbind","rslave" and "ro", and the CLI panicked with an index out of range on
"rslave". Mount options such as uid=1000 were turned into separate keys,
and an entry without "=" (e.g.
-l foo) also panicked.flag for multiple entries (same as
docker volume create -o)."=".
of panicking.
Behaviour change: several entries in one flag (
-o k1=v1,k2=v2, theform the old help text documented) are no longer split; repeat the flag
instead (
-o k1=v1 -o k2=v2), which already worked before.