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,
|
"pause": true,
|
||||||
"unpause": true,
|
"unpause": true,
|
||||||
"search": true,
|
"search": true,
|
||||||
|
"stats": true,
|
||||||
"stop": true,
|
"stop": true,
|
||||||
"top": true,
|
"top": true,
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
@ -62,6 +63,10 @@ func statsCmd(c *cli.Context) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if os.Getuid() != 0 {
|
||||||
|
return errors.New("stats is not supported for rootless containers")
|
||||||
|
}
|
||||||
|
|
||||||
all := c.Bool("all")
|
all := c.Bool("all")
|
||||||
latest := c.Bool("latest")
|
latest := c.Bool("latest")
|
||||||
ctr := 0
|
ctr := 0
|
||||||
|
|
Loading…
Reference in New Issue