diff options
Diffstat (limited to 'cmd/podman/create_cli.go')
-rw-r--r-- | cmd/podman/create_cli.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cmd/podman/create_cli.go b/cmd/podman/create_cli.go index 2a820fa43..95b9321fd 100644 --- a/cmd/podman/create_cli.go +++ b/cmd/podman/create_cli.go @@ -7,7 +7,7 @@ import ( "strings" cc "github.com/containers/libpod/pkg/spec" - "github.com/docker/docker/pkg/sysinfo" + "github.com/containers/libpod/pkg/sysinfo" "github.com/docker/go-units" spec "github.com/opencontainers/runtime-spec/specs-go" "github.com/pkg/errors" @@ -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) } |