mirror of https://github.com/containers/podman.git
rootless: show an error when stats is used
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #1371 Approved by: rhatdan
This commit is contained in:
parent
d8c2962188
commit
ecf84390ef
|
@ -35,6 +35,7 @@ var cmdsNotRequiringRootless = map[string]bool{
|
|||
"pause": true,
|
||||
"unpause": true,
|
||||
"search": true,
|
||||
"stats": true,
|
||||
"stop": true,
|
||||
"top": true,
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue