From 836ca6c008267a8f170bbf6d5af4907ca5dee16c Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Wed, 9 Nov 2022 16:28:54 -0500 Subject: [PATCH] Add podman volume create -d short option for driver Signed-off-by: Daniel J Walsh --- cmd/podman/volumes/create.go | 2 +- docs/source/markdown/podman-volume-create.1.md | 2 +- test/system/160-volumes.bats | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/podman/volumes/create.go b/cmd/podman/volumes/create.go index 69d1d97cfd..f443327a15 100644 --- a/cmd/podman/volumes/create.go +++ b/cmd/podman/volumes/create.go @@ -44,7 +44,7 @@ func init() { flags := createCommand.Flags() 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) labelFlagName := "label" diff --git a/docs/source/markdown/podman-volume-create.1.md b/docs/source/markdown/podman-volume-create.1.md index b3e556131b..967149d17b 100644 --- a/docs/source/markdown/podman-volume-create.1.md +++ b/docs/source/markdown/podman-volume-create.1.md @@ -15,7 +15,7 @@ driver options can be set using the **--opt** flag. ## OPTIONS -#### **--driver**=*driver* +#### **--driver**, **-d**=*driver* Specify the volume driver name (default **local**). There are two drivers supported by Podman itself: **local** and **image**. diff --git a/test/system/160-volumes.bats b/test/system/160-volumes.bats index 13525e725f..9fa45192fd 100644 --- a/test/system/160-volumes.bats +++ b/test/system/160-volumes.bats @@ -120,7 +120,7 @@ function teardown() { mylabel=$(random_string) # 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" # Confirm that it shows up in 'volume ls', and confirm values @@ -246,7 +246,7 @@ EOF # Podman volume import test @test "podman volume import test" { 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 volume create my_vol2