diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-08-13 21:11:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-13 21:11:21 +0200 |
commit | 9ede14e1cd3d3fa6cac0dbb0a7286a8fc0118376 (patch) | |
tree | e9d934d7ac27a2792008128f0c8acbd412818225 /pkg/specgen/generate | |
parent | 90831dfdced0f52867c47cac75b5ea09e0e916c2 (diff) | |
parent | feff414ae1d4ca68b3341fa37c4abf8fc90a55f8 (diff) | |
download | podman-9ede14e1cd3d3fa6cac0dbb0a7286a8fc0118376.tar.gz podman-9ede14e1cd3d3fa6cac0dbb0a7286a8fc0118376.tar.bz2 podman-9ede14e1cd3d3fa6cac0dbb0a7286a8fc0118376.zip |
Merge pull request #7227 from giuseppe/procfs-opts
run, create: add new security-opt proc-opts
Diffstat (limited to 'pkg/specgen/generate')
-rw-r--r-- | pkg/specgen/generate/oci.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/specgen/generate/oci.go b/pkg/specgen/generate/oci.go index ee9f63680..fd324c6e1 100644 --- a/pkg/specgen/generate/oci.go +++ b/pkg/specgen/generate/oci.go @@ -18,6 +18,18 @@ import ( "golang.org/x/sys/unix" ) +func setProcOpts(s *specgen.SpecGenerator, g *generate.Generator) { + if s.ProcOpts == nil { + return + } + for i := range g.Config.Mounts { + if g.Config.Mounts[i].Destination == "/proc" { + g.Config.Mounts[i].Options = s.ProcOpts + return + } + } +} + func addRlimits(s *specgen.SpecGenerator, g *generate.Generator) error { var ( isRootless = rootless.IsRootless() @@ -341,6 +353,8 @@ func SpecGenToOCI(ctx context.Context, s *specgen.SpecGenerator, rt *libpod.Runt configSpec.Annotations[define.InspectAnnotationInit] = define.InspectResponseFalse } + setProcOpts(s, &g) + return configSpec, nil } |