mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
specgen: allow --share-parent with --infra=false
This allows to use --share-parent with --infra=false, so that the containers in the pod can share the parent cgroup. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -123,11 +123,12 @@ func createPodOptions(p *specgen.PodSpecGenerator) ([]libpod.PodCreateOption, er
|
|||||||
var (
|
var (
|
||||||
options []libpod.PodCreateOption
|
options []libpod.PodCreateOption
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if p.ShareParent == nil || (p.ShareParent != nil && *p.ShareParent) {
|
||||||
|
options = append(options, libpod.WithPodParent())
|
||||||
|
}
|
||||||
if !p.NoInfra {
|
if !p.NoInfra {
|
||||||
options = append(options, libpod.WithInfraContainer())
|
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())
|
nsOptions, err := GetNamespaceOptions(p.SharedNamespaces, p.InfraContainerSpec.NetNS.IsHost())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Reference in New Issue
Block a user