summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-05-07 21:02:21 +0200
committerGitHub <noreply@github.com>2019-05-07 21:02:21 +0200
commit2e40bdebfd245ff04e86b1ea42f663087d97fccf (patch)
tree692e064dd2675afd75e01fa64548be8f52076cb6 /pkg
parent7b67c9601e1eab6c881ac44503c285c71b0a4a3a (diff)
parent2dfb744d8cae8e324676efcd845055f3cb0353bb (diff)
downloadpodman-2e40bdebfd245ff04e86b1ea42f663087d97fccf.tar.gz
podman-2e40bdebfd245ff04e86b1ea42f663087d97fccf.tar.bz2
podman-2e40bdebfd245ff04e86b1ea42f663087d97fccf.zip
Merge pull request #3080 from baude/remotepsnamespace
fix podman-remote ps --ns
Diffstat (limited to 'pkg')
-rw-r--r--pkg/adapter/containers.go5
-rw-r--r--pkg/adapter/containers_remote.go15
2 files changed, 20 insertions, 0 deletions
diff --git a/pkg/adapter/containers.go b/pkg/adapter/containers.go
index 0721af773..82d999202 100644
--- a/pkg/adapter/containers.go
+++ b/pkg/adapter/containers.go
@@ -1022,3 +1022,8 @@ func (r *LocalRuntime) GenerateSystemd(c *cliconfig.GenerateSystemdValues) (stri
}
return systemdgen.CreateSystemdUnitAsString(name, ctr.ID(), c.RestartPolicy, ctr.Config().StaticDir, timeout)
}
+
+// GetNamespaces returns namespace information about a container for PS
+func (r *LocalRuntime) GetNamespaces(container shared.PsContainerOutput) *shared.Namespace {
+ return shared.GetNamespaces(container.Pid)
+}
diff --git a/pkg/adapter/containers_remote.go b/pkg/adapter/containers_remote.go
index 201249fc3..c70db13ed 100644
--- a/pkg/adapter/containers_remote.go
+++ b/pkg/adapter/containers_remote.go
@@ -961,3 +961,18 @@ func (r *LocalRuntime) Port(c *cliconfig.PortValues) ([]*Container, error) {
func (r *LocalRuntime) GenerateSystemd(c *cliconfig.GenerateSystemdValues) (string, error) {
return iopodman.GenerateSystemd().Call(r.Conn, c.InputArgs[0], c.RestartPolicy, int64(c.StopTimeout), c.Name)
}
+
+// GetNamespaces returns namespace information about a container for PS
+func (r *LocalRuntime) GetNamespaces(container shared.PsContainerOutput) *shared.Namespace {
+ ns := shared.Namespace{
+ PID: container.PID,
+ Cgroup: container.Cgroup,
+ IPC: container.IPC,
+ MNT: container.MNT,
+ NET: container.NET,
+ PIDNS: container.PIDNS,
+ User: container.User,
+ UTS: container.UTS,
+ }
+ return &ns
+}