From 1d11851c2ebd16fb810b3a258229c4b077d30f58 Mon Sep 17 00:00:00 2001 From: Qi Wang Date: Wed, 19 Jun 2019 14:59:24 -0400 Subject: [PATCH] fix --volume splits comma delimited option Signed-off-by: Qi Wang Closes: #1686 Approved by: rhatdan --- cmd/buildah/run.go | 2 +- tests/run.bats | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/buildah/run.go b/cmd/buildah/run.go index ba41cb2919..b01d6c3fbb 100644 --- a/cmd/buildah/run.go +++ b/cmd/buildah/run.go @@ -71,7 +71,7 @@ func init() { if err := flags.MarkHidden("tty"); err != nil { panic(fmt.Sprintf("error marking tty flag as hidden: %v", err)) } - flags.StringSliceVarP(&opts.volumes, "volume", "v", []string{}, "bind mount a host location into the container while running the command") + flags.StringArrayVarP(&opts.volumes, "volume", "v", []string{}, "bind mount a host location into the container while running the command") userFlags := getUserFlags() namespaceFlags := buildahcli.GetNameSpaceFlags(&namespaceResults) diff --git a/tests/run.bats b/tests/run.bats index cc8fc10db1..089d6433f5 100644 --- a/tests/run.bats +++ b/tests/run.bats @@ -248,6 +248,8 @@ function configure_and_check_user() { mkdir -p ${TESTDIR}/was-empty # As a baseline, this should succeed. run_buildah --debug=false run -v ${TESTDIR}/was-empty:/var/not-empty${zflag:+:${zflag}} $cid touch /var/not-empty/testfile + # Parsing options that with comma, this should succeed. + run_buildah --debug=false run -v ${TESTDIR}/was-empty:/var/not-empty:rw,rshared${zflag:+,${zflag}} $cid touch /var/not-empty/testfile # If we're parsing the options at all, this should be read-only, so it should fail. run_buildah 1 --debug=false run -v ${TESTDIR}/was-empty:/var/not-empty:ro${zflag:+,${zflag}} $cid touch /var/not-empty/testfile # Even if the parent directory doesn't exist yet, this should succeed.