mirror of
https://github.com/containers/podman.git
synced 2025-06-19 16:33:24 +08:00
Merge pull request #8481 from Luap99/fix-remote-volume-path
Do not validate the volume source path in specgen
This commit is contained in:
@ -323,8 +323,8 @@ func getBindMount(args []string) (spec.Mount, error) {
|
|||||||
if len(kv) == 1 {
|
if len(kv) == 1 {
|
||||||
return newMount, errors.Wrapf(optionArgError, kv[0])
|
return newMount, errors.Wrapf(optionArgError, kv[0])
|
||||||
}
|
}
|
||||||
if err := parse.ValidateVolumeHostDir(kv[1]); err != nil {
|
if len(kv[1]) == 0 {
|
||||||
return newMount, err
|
return newMount, errors.Wrapf(optionArgError, "host directory cannot be empty")
|
||||||
}
|
}
|
||||||
newMount.Source = kv[1]
|
newMount.Source = kv[1]
|
||||||
setSource = true
|
setSource = true
|
||||||
|
@ -84,11 +84,10 @@ func GenVolumeMounts(volumeFlag []string) (map[string]spec.Mount, map[string]*Na
|
|||||||
return nil, nil, nil, err
|
return nil, nil, nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do not check source dir for anonymous volumes
|
// Do not check source dir for anonymous volumes
|
||||||
if len(splitVol) > 1 {
|
if len(splitVol) > 1 {
|
||||||
if err := parse.ValidateVolumeHostDir(src); err != nil {
|
if len(src) == 0 {
|
||||||
return nil, nil, nil, err
|
return nil, nil, nil, errors.New("host directory cannot be empty")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err := parse.ValidateVolumeCtrDir(dest); err != nil {
|
if err := parse.ValidateVolumeCtrDir(dest); err != nil {
|
||||||
|
Reference in New Issue
Block a user