rootless: disable pod stats

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano
2019-03-08 12:10:40 +01:00
parent 4a0fb35335
commit d6ebccf7c2
2 changed files with 19 additions and 13 deletions

View File

@ -65,19 +65,20 @@ var cmdsNotRequiringRootless = map[*cobra.Command]bool{
_exportCommand: true,
//// `info` must be executed in an user namespace.
//// If this change, please also update libpod.refreshRootless()
_loginCommand: true,
_logoutCommand: true,
_mountCommand: true,
_killCommand: true,
_pauseCommand: true,
_podKillCommand: true,
_restartCommand: true,
_runCommand: true,
_unpauseCommand: true,
_searchCommand: true,
_statsCommand: true,
_stopCommand: true,
_topCommand: true,
_loginCommand: true,
_logoutCommand: true,
_mountCommand: true,
_killCommand: true,
_pauseCommand: true,
_podKillCommand: true,
_podStatsCommand: true,
_restartCommand: true,
_runCommand: true,
_unpauseCommand: true,
_searchCommand: true,
_statsCommand: true,
_stopCommand: true,
_topCommand: true,
}
var rootCmd = &cobra.Command{

View File

@ -53,6 +53,11 @@ func init() {
}
func podStatsCmd(c *cliconfig.PodStatsValues) error {
if os.Geteuid() != 0 {
return errors.New("stats is not supported in rootless mode")
}
format := c.Format
all := c.All
latest := c.Latest