diff options
author | Matthew Heon <matthew.heon@pm.me> | 2020-04-22 13:43:28 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-04-22 14:24:12 -0400 |
commit | b4a4338dfe684dea1e919af1bec24a83708c1525 (patch) | |
tree | cb7b9b2b6c36065ba8610a88861468beefceaf80 /cmd/podman/common/specgen.go | |
parent | 703fd505538fdae2165dad47c7a6886ac3ed891e (diff) | |
download | podman-b4a4338dfe684dea1e919af1bec24a83708c1525.tar.gz podman-b4a4338dfe684dea1e919af1bec24a83708c1525.tar.bz2 podman-b4a4338dfe684dea1e919af1bec24a83708c1525.zip |
Enable basic volumes support in Podmanv2
This enables the --volume, --mount, and --tmpfs flags in
Podmanv2. It does not enable init-related flags, image volumes,
and --volumes-from.
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'cmd/podman/common/specgen.go')
-rw-r--r-- | cmd/podman/common/specgen.go | 27 |
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 |