summaryrefslogtreecommitdiff
path: root/libpod/pod.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-07-15 17:30:16 -0400
committerGitHub <noreply@github.com>2021-07-15 17:30:16 -0400
commit12b67aaf62b6e99f94db7ea89dad87f16a9fbd86 (patch)
treece0c74860f2ccaeb7e85dceb4bbd370d1b282b93 /libpod/pod.go
parent9d87dc74084b9b1ae67106a23cf3ed5327ca0681 (diff)
parentf7321681d04d65da3b307d1e5e4ba12c42b5c456 (diff)
downloadpodman-12b67aaf62b6e99f94db7ea89dad87f16a9fbd86.tar.gz
podman-12b67aaf62b6e99f94db7ea89dad87f16a9fbd86.tar.bz2
podman-12b67aaf62b6e99f94db7ea89dad87f16a9fbd86.zip
Merge pull request #10894 from cdoern/pidPod
podman pod create --pid flag
Diffstat (limited to 'libpod/pod.go')
-rw-r--r--libpod/pod.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/libpod/pod.go b/libpod/pod.go
index d7a9b15d9..c03059c82 100644
--- a/libpod/pod.go
+++ b/libpod/pod.go
@@ -7,6 +7,7 @@ import (
"github.com/containers/podman/v3/libpod/define"
"github.com/containers/podman/v3/libpod/lock"
+ "github.com/containers/podman/v3/pkg/specgen"
"github.com/cri-o/ocicni/pkg/ocicni"
"github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
@@ -97,6 +98,7 @@ type InfraContainerConfig struct {
HasInfraContainer bool `json:"makeInfraContainer"`
NoNetwork bool `json:"noNetwork,omitempty"`
HostNetwork bool `json:"infraHostNetwork,omitempty"`
+ PidNS specgen.Namespace `json:"infraPid,omitempty"`
PortBindings []ocicni.PortMapping `json:"infraPortBindings"`
StaticIP net.IP `json:"staticIP,omitempty"`
StaticMAC net.HardwareAddr `json:"staticMAC,omitempty"`
@@ -170,6 +172,11 @@ func (p *Pod) CPUQuota() int64 {
return 0
}
+// PidMode returns the PID mode given by the user ex: pod, private...
+func (p *Pod) PidMode() string {
+ return string(p.config.InfraContainer.PidNS.NSMode)
+}
+
// Labels returns the pod's labels
func (p *Pod) Labels() map[string]string {
labels := make(map[string]string)