aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-04-27 20:37:03 +0200
committerGitHub <noreply@github.com>2020-04-27 20:37:03 +0200
commit733c38028df9d8c0b0688a54ef948a21b6260f26 (patch)
treeea9d691a33291bc4dc635296283c9f5de3d315a3 /pkg
parentccf009d22e45e9a517b65619d6d46a8d40cb3328 (diff)
parent1803b28d8cae1fd6c5e2ea508911309251a1349a (diff)
downloadpodman-733c38028df9d8c0b0688a54ef948a21b6260f26.tar.gz
podman-733c38028df9d8c0b0688a54ef948a21b6260f26.tar.bz2
podman-733c38028df9d8c0b0688a54ef948a21b6260f26.zip
Merge pull request #5999 from giuseppe/fix-pod-infra-container
v2, podman: fix pod tests
Diffstat (limited to 'pkg')
-rw-r--r--pkg/domain/entities/container_ps.go28
-rw-r--r--pkg/specgen/namespaces.go4
2 files changed, 32 insertions, 0 deletions
diff --git a/pkg/domain/entities/container_ps.go b/pkg/domain/entities/container_ps.go
index 709bb58d6..d5159fb85 100644
--- a/pkg/domain/entities/container_ps.go
+++ b/pkg/domain/entities/container_ps.go
@@ -159,3 +159,31 @@ func SortPsOutput(sortBy string, psOutput SortListContainers) (SortListContainer
}
return psOutput, nil
}
+
+func (l ListContainer) CGROUPNS() string {
+ return l.Namespaces.Cgroup
+}
+
+func (l ListContainer) IPC() string {
+ return l.Namespaces.IPC
+}
+
+func (l ListContainer) MNT() string {
+ return l.Namespaces.MNT
+}
+
+func (l ListContainer) NET() string {
+ return l.Namespaces.NET
+}
+
+func (l ListContainer) PIDNS() string {
+ return l.Namespaces.PIDNS
+}
+
+func (l ListContainer) USERNS() string {
+ return l.Namespaces.User
+}
+
+func (l ListContainer) UTS() string {
+ return l.Namespaces.UTS
+}
diff --git a/pkg/specgen/namespaces.go b/pkg/specgen/namespaces.go
index cee49ff51..f0161a793 100644
--- a/pkg/specgen/namespaces.go
+++ b/pkg/specgen/namespaces.go
@@ -159,6 +159,8 @@ func (n *Namespace) validate() error {
func ParseNamespace(ns string) (Namespace, error) {
toReturn := Namespace{}
switch {
+ case ns == "pod":
+ toReturn.NSMode = FromPod
case ns == "host":
toReturn.NSMode = Host
case ns == "private":
@@ -214,6 +216,8 @@ func ParseNetworkNamespace(ns string) (Namespace, []string, error) {
toReturn := Namespace{}
var cniNetworks []string
switch {
+ case ns == "pod":
+ toReturn.NSMode = FromPod
case ns == "bridge":
toReturn.NSMode = Bridge
case ns == "none":