summaryrefslogtreecommitdiff
path: root/cmd/podman/top.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-02-26 09:08:19 -0600
committerAtomic Bot <atomic-devel@projectatomic.io>2018-02-26 23:41:47 +0000
commit6cb1c31d3f9e575688ace95206898c7fff0c88f9 (patch)
tree70bd6b99e6e8068abfadbd224126512d9625bb00 /cmd/podman/top.go
parentf47a5be60d91fd2055ed6afbb6bb014c9635f2df (diff)
downloadpodman-6cb1c31d3f9e575688ace95206898c7fff0c88f9.tar.gz
podman-6cb1c31d3f9e575688ace95206898c7fff0c88f9.tar.bz2
podman-6cb1c31d3f9e575688ace95206898c7fff0c88f9.zip
Restrict top output to container's pids only
Due to the way ps arguments work, it was possible to display pids that dont below to the container in top output. We now filter pids that dont belong to the container out of the output. This also means the pid column must be present in the output or we throw an error. This resolves issue #391 Signed-off-by: baude <bbaude@redhat.com> Closes: #400 Approved by: rhatdan
Diffstat (limited to 'cmd/podman/top.go')
-rw-r--r--cmd/podman/top.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/podman/top.go b/cmd/podman/top.go
index 6aff25a71..5ff3b6643 100644
--- a/cmd/podman/top.go
+++ b/cmd/podman/top.go
@@ -70,11 +70,11 @@ func topCmd(c *cli.Context) error {
psArgs = append(psArgs, psOpts...)
- results, err := container.GetContainerPidInformation(psArgs)
+ psOutput, err := container.GetContainerPidInformation(psArgs)
if err != nil {
return err
}
- for _, line := range results {
+ for _, line := range psOutput {
fmt.Println(line)
}
return nil