From ecf84390ef8fbcdf31d6429f47cd15f12d83faf4 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Wed, 29 Aug 2018 10:28:40 +0200 Subject: rootless: show an error when stats is used Signed-off-by: Giuseppe Scrivano Closes: #1371 Approved by: rhatdan --- cmd/podman/stats.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cmd/podman/stats.go') 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 -- cgit v1.2.3-54-g00ecf