diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-02-04 09:41:12 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-04 09:41:12 -0500 |
commit | 956664f65b5ebcc07a47c4d03c663c32733ed1ad (patch) | |
tree | 6033580c76d4d9cdbf1752553519962e7c4e6d03 /pkg/specgen/generate | |
parent | 2a48a88629850638837f6081f8d11d90be923324 (diff) | |
parent | 9eb88ea474c3f6160090573c4bae3fe4c5ece016 (diff) | |
download | podman-956664f65b5ebcc07a47c4d03c663c32733ed1ad.tar.gz podman-956664f65b5ebcc07a47c4d03c663c32733ed1ad.tar.bz2 podman-956664f65b5ebcc07a47c4d03c663c32733ed1ad.zip |
Merge pull request #12930 from cdoern/podCgroup
Podman pod create --share-parent vs --share=cgroup
Diffstat (limited to 'pkg/specgen/generate')
-rw-r--r-- | pkg/specgen/generate/namespaces.go | 2 | ||||
-rw-r--r-- | pkg/specgen/generate/pod_create.go | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/pkg/specgen/generate/namespaces.go b/pkg/specgen/generate/namespaces.go index 93d9caf4c..3f77cbe76 100644 --- a/pkg/specgen/generate/namespaces.go +++ b/pkg/specgen/generate/namespaces.go @@ -482,7 +482,7 @@ func GetNamespaceOptions(ns []string, netnsIsHost bool) ([]libpod.PodCreateOptio for _, toShare := range ns { switch toShare { case "cgroup": - options = append(options, libpod.WithPodCgroups()) + options = append(options, libpod.WithPodCgroup()) case "net": // share the netns setting with other containers in the pod only when it is not set to host if !netnsIsHost { diff --git a/pkg/specgen/generate/pod_create.go b/pkg/specgen/generate/pod_create.go index 03829e8cf..68fda3ad7 100644 --- a/pkg/specgen/generate/pod_create.go +++ b/pkg/specgen/generate/pod_create.go @@ -166,6 +166,9 @@ func createPodOptions(p *specgen.PodSpecGenerator, rt *libpod.Runtime, infraSpec ) if !p.NoInfra { //&& infraSpec != nil { options = append(options, libpod.WithInfraContainer()) + if p.ShareParent == nil || (p.ShareParent != nil && *p.ShareParent) { + options = append(options, libpod.WithPodParent()) + } nsOptions, err := GetNamespaceOptions(p.SharedNamespaces, p.InfraContainerSpec.NetNS.IsHost()) if err != nil { return nil, err |