summaryrefslogtreecommitdiff
path: root/cmd/podman/ps.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-10-25 13:08:45 -0700
committerGitHub <noreply@github.com>2018-10-25 13:08:45 -0700
commitf6e7807fa5970f328c1221c2e0c0aafe5f1c4b34 (patch)
tree91e518a3653694f50ae4b9a9f3b3423b2ff968e6 /cmd/podman/ps.go
parent3efa0685289a44ab21015897253565b9c50c1777 (diff)
parent3e5a5c68da9884ddb46cb9e84435956996347a4b (diff)
downloadpodman-f6e7807fa5970f328c1221c2e0c0aafe5f1c4b34.tar.gz
podman-f6e7807fa5970f328c1221c2e0c0aafe5f1c4b34.tar.bz2
podman-f6e7807fa5970f328c1221c2e0c0aafe5f1c4b34.zip
Merge pull request #1709 from baude/parallelheur
Add --max-workers and heuristics for parallel operations
Diffstat (limited to 'cmd/podman/ps.go')
-rw-r--r--cmd/podman/ps.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/cmd/podman/ps.go b/cmd/podman/ps.go
index a468f6121..fa333f952 100644
--- a/cmd/podman/ps.go
+++ b/cmd/podman/ps.go
@@ -20,6 +20,7 @@ import (
"github.com/cri-o/ocicni/pkg/ocicni"
"github.com/docker/go-units"
"github.com/pkg/errors"
+ "github.com/sirupsen/logrus"
"github.com/urfave/cli"
"k8s.io/apimachinery/pkg/fields"
)
@@ -300,7 +301,13 @@ func psCmd(c *cli.Context) error {
outputContainers = []*libpod.Container{latestCtr}
}
- pss := shared.PBatch(outputContainers, 8, opts)
+ maxWorkers := shared.Parallelize("ps")
+ if c.GlobalIsSet("max-workers") {
+ maxWorkers = c.GlobalInt("max-workers")
+ }
+ logrus.Debugf("Setting maximum workers to %d", maxWorkers)
+
+ pss := shared.PBatch(outputContainers, maxWorkers, opts)
if opts.Sort != "" {
pss, err = sortPsOutput(opts.Sort, pss)
if err != nil {