summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/main.go1
-rw-r--r--cmd/podman/stats.go5
2 files changed, 6 insertions, 0 deletions
diff --git a/cmd/podman/main.go b/cmd/podman/main.go
index 538eaaac2..c82c018fa 100644
--- a/cmd/podman/main.go
+++ b/cmd/podman/main.go
@@ -35,6 +35,7 @@ var cmdsNotRequiringRootless = map[string]bool{
"pause": true,
"unpause": true,
"search": true,
+ "stats": true,
"stop": true,
"top": true,
}
diff --git a/cmd/podman/stats.go b/cmd/podman/stats.go
index 45868e8d7..2d6a2a3d2 100644
--- a/cmd/podman/stats.go
+++ b/cmd/podman/stats.go
@@ -2,6 +2,7 @@ package main
import (
"fmt"
+ "os"
"reflect"
"strings"
"time"
@@ -62,6 +63,10 @@ func statsCmd(c *cli.Context) error {
return err
}
+ if os.Getuid() != 0 {
+ return errors.New("stats is not supported for rootless containers")
+ }
+
all := c.Bool("all")
latest := c.Bool("latest")
ctr := 0