diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-01-10 11:58:08 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-10 11:58:08 -0800 |
commit | 7d2632872a875ad0baca0f812e0f8d9d97617977 (patch) | |
tree | 8e277ff486162ec0c1d0b24e224e3ffee48fdcb3 /cmd | |
parent | 4fb60450878127f0d8e5c240075d25bd49b91433 (diff) | |
parent | f2ff550967660a611f8f28e9bd79d39bc007c104 (diff) | |
download | podman-7d2632872a875ad0baca0f812e0f8d9d97617977.tar.gz podman-7d2632872a875ad0baca0f812e0f8d9d97617977.tar.bz2 podman-7d2632872a875ad0baca0f812e0f8d9d97617977.zip |
Merge pull request #2120 from rhatdan/volume
Fix handling of nil volumes
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/create_cli.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/podman/create_cli.go b/cmd/podman/create_cli.go index 1a0830f2e..95b9321fd 100644 --- a/cmd/podman/create_cli.go +++ b/cmd/podman/create_cli.go @@ -201,6 +201,9 @@ func parseVolumesFrom(volumesFrom []string) error { } func validateVolumeHostDir(hostDir string) error { + if len(hostDir) == 0 { + return errors.Errorf("host directory cannot be empty") + } if filepath.IsAbs(hostDir) { if _, err := os.Stat(hostDir); err != nil { return errors.Wrapf(err, "error checking path %q", hostDir) @@ -212,6 +215,9 @@ func validateVolumeHostDir(hostDir string) error { } func validateVolumeCtrDir(ctrDir string) error { + if len(ctrDir) == 0 { + return errors.Errorf("container directory cannot be empty") + } if !filepath.IsAbs(ctrDir) { return errors.Errorf("invalid container path, must be an absolute path %q", ctrDir) } |