summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
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,