summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-10-29 18:15:24 +0100
committerGitHub <noreply@github.com>2020-10-29 18:15:24 +0100
commitc8f0e1dab602ed94af95dc4f604f161696f249e0 (patch)
tree1d8fe4e091300aa7c2c6e61fcb1a509c382974b0 /pkg/specgen/generate
parente439aec4fa867cda0672079dac0fe394dfb3306c (diff)
parent65a618886efc48562e5b9ff99ca630c83622419b (diff)
downloadpodman-c8f0e1dab602ed94af95dc4f604f161696f249e0.tar.gz
podman-c8f0e1dab602ed94af95dc4f604f161696f249e0.tar.bz2
podman-c8f0e1dab602ed94af95dc4f604f161696f249e0.zip
Merge pull request #8146 from vrothberg/image-mounts
new "image" mount type
Diffstat (limited to 'pkg/specgen/generate')
-rw-r--r--pkg/specgen/generate/container_create.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/pkg/specgen/generate/container_create.go b/pkg/specgen/generate/container_create.go
index f051537de..53dc35df1 100644
--- a/pkg/specgen/generate/container_create.go
+++ b/pkg/specgen/generate/container_create.go
@@ -223,6 +223,9 @@ func createContainerOptions(ctx context.Context, rt *libpod.Runtime, s *specgen.
for _, overlayVolume := range s.OverlayVolumes {
destinations = append(destinations, overlayVolume.Destination)
}
+ for _, imageVolume := range s.ImageVolumes {
+ destinations = append(destinations, imageVolume.Destination)
+ }
options = append(options, libpod.WithUserVolumes(destinations))
if len(volumes) != 0 {
@@ -248,6 +251,18 @@ func createContainerOptions(ctx context.Context, rt *libpod.Runtime, s *specgen.
options = append(options, libpod.WithOverlayVolumes(vols))
}
+ if len(s.ImageVolumes) != 0 {
+ var vols []*libpod.ContainerImageVolume
+ for _, v := range s.ImageVolumes {
+ vols = append(vols, &libpod.ContainerImageVolume{
+ Dest: v.Destination,
+ Source: v.Source,
+ ReadWrite: v.ReadWrite,
+ })
+ }
+ options = append(options, libpod.WithImageVolumes(vols))
+ }
+
if s.Command != nil {
options = append(options, libpod.WithCommand(s.Command))
}