aboutsummaryrefslogtreecommitdiff
path: root/pkg/spec/spec.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-04-29 16:01:05 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-05-01 10:19:05 -0400
commit606cee93bfabe2b8177dad53168e51cd1aeeb9ee (patch)
tree7e2d2d5f5bc93cd91c3c915834920c5e6a806fae /pkg/spec/spec.go
parentc86647d2037f5bb042f8703845098e35c620df48 (diff)
downloadpodman-606cee93bfabe2b8177dad53168e51cd1aeeb9ee.tar.gz
podman-606cee93bfabe2b8177dad53168e51cd1aeeb9ee.tar.bz2
podman-606cee93bfabe2b8177dad53168e51cd1aeeb9ee.zip
Move handling of ReadOnlyTmpfs into new mounts code
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'pkg/spec/spec.go')
-rw-r--r--pkg/spec/spec.go52
1 files changed, 0 insertions, 52 deletions
diff --git a/pkg/spec/spec.go b/pkg/spec/spec.go
index 591a28703..20c649f9a 100644
--- a/pkg/spec/spec.go
+++ b/pkg/spec/spec.go
@@ -7,7 +7,6 @@ import (
"github.com/containers/libpod/libpod"
"github.com/containers/libpod/pkg/rootless"
- "github.com/containers/storage/pkg/mount"
pmount "github.com/containers/storage/pkg/mount"
"github.com/docker/docker/oci/caps"
"github.com/docker/go-units"
@@ -278,57 +277,6 @@ func (config *CreateConfig) createConfigToOCISpec(runtime *libpod.Runtime, userM
addedResources = true
}
- for _, i := range config.Tmpfs {
- // Default options if nothing passed
- options := []string{"rw", "rprivate", "noexec", "nosuid", "nodev", "size=65536k"}
- spliti := strings.SplitN(i, ":", 2)
- if len(spliti) > 1 {
- if _, _, err := mount.ParseTmpfsOptions(spliti[1]); err != nil {
- return nil, err
- }
- options = strings.Split(spliti[1], ",")
- }
- tmpfsMnt := spec.Mount{
- Destination: spliti[0],
- Type: "tmpfs",
- Source: "tmpfs",
- Options: append(options, "tmpcopyup"),
- }
- g.AddMount(tmpfsMnt)
- }
-
- for _, m := range config.Mounts {
- if m.Type == "tmpfs" {
- g.AddMount(m)
- }
- }
-
- if config.ReadOnlyRootfs && config.ReadOnlyTmpfs {
- options := []string{"rw", "rprivate", "nosuid", "nodev", "tmpcopyup"}
- for _, i := range []string{"/tmp", "/var/tmp"} {
- if libpod.MountExists(g.Config.Mounts, i) {
- continue
- }
- // Default options if nothing passed
- tmpfsMnt := spec.Mount{
- Destination: i,
- Type: "tmpfs",
- Source: "tmpfs",
- Options: options,
- }
- g.AddMount(tmpfsMnt)
- }
- if !libpod.MountExists(g.Config.Mounts, "/run") {
- tmpfsMnt := spec.Mount{
- Destination: "/run",
- Type: "tmpfs",
- Source: "tmpfs",
- Options: append(options, "noexec", "size=65536k"),
- }
- g.AddMount(tmpfsMnt)
- }
- }
-
for name, val := range config.Env {
g.AddProcessEnv(name, val)
}