summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-03-30 13:59:37 +0200
committerGitHub <noreply@github.com>2020-03-30 13:59:37 +0200
commit819375128741f0348b8e4ffd33a96c666e82ee4f (patch)
treead2c5ce70d77fb1085a39427425550119afc4d6f /libpod
parent598bb53d46dfc85b8bcc1e3000736106f80de93e (diff)
parentedec8ccf3f1f2e1b1926530b62ab441fc1a24f3f (diff)
downloadpodman-819375128741f0348b8e4ffd33a96c666e82ee4f.tar.gz
podman-819375128741f0348b8e4ffd33a96c666e82ee4f.tar.bz2
podman-819375128741f0348b8e4ffd33a96c666e82ee4f.zip
Merge pull request #5639 from vrothberg/v2-pod-top
V2 pod top
Diffstat (limited to 'libpod')
-rw-r--r--libpod/pod_top_linux.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/libpod/pod_top_linux.go b/libpod/pod_top_linux.go
index 80221c3a9..1f84c8667 100644
--- a/libpod/pod_top_linux.go
+++ b/libpod/pod_top_linux.go
@@ -41,12 +41,23 @@ func (p *Pod) GetPodPidInformation(descriptors []string) ([]string, error) {
}
c.lock.Unlock()
}
+
+ // Also support comma-separated input.
+ psgoDescriptors := []string{}
+ for _, d := range descriptors {
+ for _, s := range strings.Split(d, ",") {
+ if s != "" {
+ psgoDescriptors = append(psgoDescriptors, s)
+ }
+ }
+ }
+
// TODO: psgo returns a [][]string to give users the ability to apply
// filters on the data. We need to change the API here and the
// varlink API to return a [][]string if we want to make use of
// filtering.
opts := psgo.JoinNamespaceOpts{FillMappings: rootless.IsRootless()}
- output, err := psgo.JoinNamespaceAndProcessInfoByPidsWithOptions(pids, descriptors, &opts)
+ output, err := psgo.JoinNamespaceAndProcessInfoByPidsWithOptions(pids, psgoDescriptors, &opts)
if err != nil {
return nil, err
}