summaryrefslogtreecommitdiff
path: root/cmd/podman/common/specgen.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-04-22 23:27:07 +0200
committerGitHub <noreply@github.com>2020-04-22 23:27:07 +0200
commitbf1e5b875f365cc42cfd2a88fbe7e577e05a49f7 (patch)
tree1849329a38aaee36982abe4ded325f39c3263b59 /cmd/podman/common/specgen.go
parent142757bd7288ccdb88d8f1322932f999ffb18c02 (diff)
parentb4a4338dfe684dea1e919af1bec24a83708c1525 (diff)
downloadpodman-bf1e5b875f365cc42cfd2a88fbe7e577e05a49f7.tar.gz
podman-bf1e5b875f365cc42cfd2a88fbe7e577e05a49f7.tar.bz2
podman-bf1e5b875f365cc42cfd2a88fbe7e577e05a49f7.zip
Merge pull request #5942 from mheon/volume_flags
Enable basic volumes support in Podmanv2
Diffstat (limited to 'cmd/podman/common/specgen.go')
-rw-r--r--cmd/podman/common/specgen.go27
1 files changed, 18 insertions, 9 deletions
diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go
index 1e857ea01..10ae0bb2d 100644
--- a/cmd/podman/common/specgen.go
+++ b/cmd/podman/common/specgen.go
@@ -548,22 +548,31 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string
}
s.SeccompPolicy = c.SeccompPolicy
+
+ // TODO: should parse out options
+ s.VolumesFrom = c.VolumesFrom
+
+ // Only add read-only tmpfs mounts in case that we are read-only and the
+ // read-only tmpfs flag has been set.
+ mounts, volumes, err := parseVolumes(c.Volume, c.Mount, c.TmpFS, (c.ReadOnlyTmpFS && c.ReadOnly))
+ if err != nil {
+ return err
+ }
+ s.Mounts = mounts
+ s.Volumes = volumes
+
// TODO any idea why this was done
- // storage.go from spec/
- // grab it
- //volumes := rtc.Containers.Volumes
+ //devices := rtc.Containers.Devices
// TODO conflict on populate?
- //if v := c.Volume; len(v)> 0 {
- // s.Volumes = append(volumes, c.StringSlice("volume")...)
+ //
+ //if c.Changed("device") {
+ // devices = append(devices, c.StringSlice("device")...)
//}
- //s.volu
-
- //s.Mounts = c.Mount
- s.VolumesFrom = c.VolumesFrom
for _, dev := range c.Devices {
s.Devices = append(s.Devices, specs.LinuxDevice{Path: dev})
}
+
// TODO things i cannot find in spec
// we dont think these are in the spec
// init - initbinary