aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-03-18 22:51:22 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-03-19 15:01:50 +0100
commit3f96d3617bd41a0fe653892c3c3675777b7aadf3 (patch)
tree5f692854c5ef8dee74944ed585cdf5c5084e5464 /cmd
parent69593923e08dcae27a7f56657f637cb79292a450 (diff)
downloadpodman-3f96d3617bd41a0fe653892c3c3675777b7aadf3.tar.gz
podman-3f96d3617bd41a0fe653892c3c3675777b7aadf3.tar.bz2
podman-3f96d3617bd41a0fe653892c3c3675777b7aadf3.zip
rootless: fix ps command
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/main.go1
-rw-r--r--cmd/podman/ps.go4
2 files changed, 5 insertions, 0 deletions
diff --git a/cmd/podman/main.go b/cmd/podman/main.go
index ef300ef75..204344695 100644
--- a/cmd/podman/main.go
+++ b/cmd/podman/main.go
@@ -78,6 +78,7 @@ var cmdsNotRequiringRootless = map[*cobra.Command]bool{
_podStopCommand: true,
_podTopCommand: true,
_restartCommand: true,
+ &_psCommand: true,
_rmCommand: true,
_runCommand: true,
_unpauseCommand: true,
diff --git a/cmd/podman/ps.go b/cmd/podman/ps.go
index de6966c3b..ad942da2e 100644
--- a/cmd/podman/ps.go
+++ b/cmd/podman/ps.go
@@ -17,6 +17,7 @@ import (
"github.com/containers/libpod/cmd/podman/libpodruntime"
"github.com/containers/libpod/cmd/podman/shared"
"github.com/containers/libpod/libpod"
+ "github.com/containers/libpod/pkg/rootless"
"github.com/containers/libpod/pkg/util"
"github.com/cri-o/ocicni/pkg/ocicni"
"github.com/docker/go-units"
@@ -200,6 +201,9 @@ func init() {
}
func psCmd(c *cliconfig.PsValues) error {
+ if os.Geteuid() != 0 {
+ rootless.SetSkipStorageSetup(true)
+ }
if c.Bool("trace") {
span, _ := opentracing.StartSpanFromContext(Ctx, "psCmd")
defer span.Finish()