aboutsummaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
authorflouthoc <flouthoc.git@gmail.com>2021-08-16 16:36:34 +0530
committerflouthoc <flouthoc.git@gmail.com>2021-08-16 16:36:39 +0530
commitf985699460317be7428d775509ec822fc5be0e25 (patch)
tree429fb21f5f54dd72b94f0677735ad26f78280c38 /libpod/options.go
parenta38d7530dbe7d39cb76c16b2b44f96f870223fca (diff)
downloadpodman-f985699460317be7428d775509ec822fc5be0e25.tar.gz
podman-f985699460317be7428d775509ec822fc5be0e25.tar.bz2
podman-f985699460317be7428d775509ec822fc5be0e25.zip
volume: move validating volume dest from client to server.
[NO TESTS NEEDED] Signed-off-by: flouthoc <flouthoc.git@gmail.com>
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go
index b94ef88ba..89901b094 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -1456,6 +1456,10 @@ func WithNamedVolumes(volumes []*ContainerNamedVolume) CtrCreateOption {
return errors.Wrapf(err, "error processing options for named volume %q mounted at %q", vol.Name, vol.Dest)
}
+ if err = parse.ValidateVolumeCtrDir(vol.Dest); err != nil {
+ return errors.Wrapf(err, "error validating destination path for named volume %q mounted at %q", vol.Name, vol.Dest)
+ }
+
ctr.config.NamedVolumes = append(ctr.config.NamedVolumes, &ContainerNamedVolume{
Name: vol.Name,
Dest: vol.Dest,