aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/ps.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/ps.go')
-rw-r--r--cmd/podman/ps.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/cmd/podman/ps.go b/cmd/podman/ps.go
index a468f6121..d63618e58 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 {
@@ -344,7 +351,9 @@ func psCmd(c *cli.Context) error {
// Output Namespace headers
fmt.Fprintf(w, "\n%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s", hid, hnames, nspid, nscgroup, nsipc, nsmnt, nsnet, nspidns, nsuserns, nsuts)
}
-
+ if len(pss) == 0 {
+ fmt.Fprint(w, "\n")
+ }
// Now iterate each container and output its information
for _, container := range pss {