aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/stats.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2018-08-29 10:28:40 +0200
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-29 16:25:20 +0000
commitecf84390ef8fbcdf31d6429f47cd15f12d83faf4 (patch)
treebea69bfc5f879ced1ed2c9e500566a8c98085aaa /cmd/podman/stats.go
parentd8c2962188a8c6900e609c0dced5a662fcc18272 (diff)
downloadpodman-ecf84390ef8fbcdf31d6429f47cd15f12d83faf4.tar.gz
podman-ecf84390ef8fbcdf31d6429f47cd15f12d83faf4.tar.bz2
podman-ecf84390ef8fbcdf31d6429f47cd15f12d83faf4.zip
rootless: show an error when stats is used
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #1371 Approved by: rhatdan
Diffstat (limited to 'cmd/podman/stats.go')
-rw-r--r--cmd/podman/stats.go5
1 files changed, 5 insertions, 0 deletions
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