summaryrefslogtreecommitdiff
path: root/pkg/specgenutil/createparse.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-05-24 13:49:01 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2022-05-26 14:16:26 -0400
commitfb163976f4d46bbcbd793bd7a07a2c688d7924b5 (patch)
tree782e2a981d65cbad129df62ab541145394e83883 /pkg/specgenutil/createparse.go
parent5f097c371f6ea13829b70a0a508464e57027bc8b (diff)
downloadpodman-fb163976f4d46bbcbd793bd7a07a2c688d7924b5.tar.gz
podman-fb163976f4d46bbcbd793bd7a07a2c688d7924b5.tar.bz2
podman-fb163976f4d46bbcbd793bd7a07a2c688d7924b5.zip
Support setting image_volume_mode in containers.conf
Fixes: https://github.com/containers/podman/issues/14230 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/specgenutil/createparse.go')
-rw-r--r--pkg/specgenutil/createparse.go17
1 files changed, 1 insertions, 16 deletions
diff --git a/pkg/specgenutil/createparse.go b/pkg/specgenutil/createparse.go
index fb5f9c351..132f93771 100644
--- a/pkg/specgenutil/createparse.go
+++ b/pkg/specgenutil/createparse.go
@@ -18,20 +18,5 @@ func validate(c *entities.ContainerCreateOptions) error {
return err
}
- var imageVolType = map[string]string{
- "bind": "",
- "tmpfs": "",
- "ignore": "",
- }
- if _, ok := imageVolType[c.ImageVolume]; !ok {
- switch {
- case c.IsInfra:
- c.ImageVolume = "bind"
- case c.IsClone: // the image volume type will be deduced later from the container we are cloning
- return nil
- default:
- return errors.Errorf("invalid image-volume type %q. Pick one of bind, tmpfs, or ignore", c.ImageVolume)
- }
- }
- return nil
+ return config.ValidateImageVolumeMode(c.ImageVolume)
}