mirror of
https://github.com/containers/podman.git
synced 2025-09-19 00:56:15 +08:00
Add podman volume create -d short option for driver
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -44,7 +44,7 @@ func init() {
|
|||||||
flags := createCommand.Flags()
|
flags := createCommand.Flags()
|
||||||
|
|
||||||
driverFlagName := "driver"
|
driverFlagName := "driver"
|
||||||
flags.StringVar(&createOpts.Driver, driverFlagName, "local", "Specify volume driver name")
|
flags.StringVarP(&createOpts.Driver, driverFlagName, "d", "local", "Specify volume driver name")
|
||||||
_ = createCommand.RegisterFlagCompletionFunc(driverFlagName, completion.AutocompleteNone)
|
_ = createCommand.RegisterFlagCompletionFunc(driverFlagName, completion.AutocompleteNone)
|
||||||
|
|
||||||
labelFlagName := "label"
|
labelFlagName := "label"
|
||||||
|
@ -15,7 +15,7 @@ driver options can be set using the **--opt** flag.
|
|||||||
|
|
||||||
## OPTIONS
|
## OPTIONS
|
||||||
|
|
||||||
#### **--driver**=*driver*
|
#### **--driver**, **-d**=*driver*
|
||||||
|
|
||||||
Specify the volume driver name (default **local**).
|
Specify the volume driver name (default **local**).
|
||||||
There are two drivers supported by Podman itself: **local** and **image**.
|
There are two drivers supported by Podman itself: **local** and **image**.
|
||||||
|
@ -120,7 +120,7 @@ function teardown() {
|
|||||||
mylabel=$(random_string)
|
mylabel=$(random_string)
|
||||||
|
|
||||||
# Create a named volume
|
# Create a named volume
|
||||||
run_podman volume create --label l=$mylabel $myvolume
|
run_podman volume create -d local --label l=$mylabel $myvolume
|
||||||
is "$output" "$myvolume" "output from volume create"
|
is "$output" "$myvolume" "output from volume create"
|
||||||
|
|
||||||
# Confirm that it shows up in 'volume ls', and confirm values
|
# Confirm that it shows up in 'volume ls', and confirm values
|
||||||
@ -246,7 +246,7 @@ EOF
|
|||||||
# Podman volume import test
|
# Podman volume import test
|
||||||
@test "podman volume import test" {
|
@test "podman volume import test" {
|
||||||
skip_if_remote "volumes import is not applicable on podman-remote"
|
skip_if_remote "volumes import is not applicable on podman-remote"
|
||||||
run_podman volume create my_vol
|
run_podman volume create --driver local my_vol
|
||||||
run_podman run --rm -v my_vol:/data $IMAGE sh -c "echo hello >> /data/test"
|
run_podman run --rm -v my_vol:/data $IMAGE sh -c "echo hello >> /data/test"
|
||||||
run_podman volume create my_vol2
|
run_podman volume create my_vol2
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user