Skip to content

Commit

Permalink
fix --volume splits comma delimited option
Browse files Browse the repository at this point in the history
Signed-off-by: Qi Wang <qiwan@redhat.com>

Closes: containers#1686
Approved by: rhatdan
  • Loading branch information
QiWang19 authored and rh-atomic-bot committed Jun 21, 2019
1 parent 07aaf5e commit 1d11851
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/buildah/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions tests/run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 1d11851

Please sign in to comment.