mirror of
https://github.com/containers/podman.git
synced 2025-06-25 03:52:15 +08:00
rootless: disable pod stats
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -65,19 +65,20 @@ var cmdsNotRequiringRootless = map[*cobra.Command]bool{
|
|||||||
_exportCommand: true,
|
_exportCommand: true,
|
||||||
//// `info` must be executed in an user namespace.
|
//// `info` must be executed in an user namespace.
|
||||||
//// If this change, please also update libpod.refreshRootless()
|
//// If this change, please also update libpod.refreshRootless()
|
||||||
_loginCommand: true,
|
_loginCommand: true,
|
||||||
_logoutCommand: true,
|
_logoutCommand: true,
|
||||||
_mountCommand: true,
|
_mountCommand: true,
|
||||||
_killCommand: true,
|
_killCommand: true,
|
||||||
_pauseCommand: true,
|
_pauseCommand: true,
|
||||||
_podKillCommand: true,
|
_podKillCommand: true,
|
||||||
_restartCommand: true,
|
_podStatsCommand: true,
|
||||||
_runCommand: true,
|
_restartCommand: true,
|
||||||
_unpauseCommand: true,
|
_runCommand: true,
|
||||||
_searchCommand: true,
|
_unpauseCommand: true,
|
||||||
_statsCommand: true,
|
_searchCommand: true,
|
||||||
_stopCommand: true,
|
_statsCommand: true,
|
||||||
_topCommand: true,
|
_stopCommand: true,
|
||||||
|
_topCommand: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
var rootCmd = &cobra.Command{
|
var rootCmd = &cobra.Command{
|
||||||
|
@ -53,6 +53,11 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func podStatsCmd(c *cliconfig.PodStatsValues) error {
|
func podStatsCmd(c *cliconfig.PodStatsValues) error {
|
||||||
|
|
||||||
|
if os.Geteuid() != 0 {
|
||||||
|
return errors.New("stats is not supported in rootless mode")
|
||||||
|
}
|
||||||
|
|
||||||
format := c.Format
|
format := c.Format
|
||||||
all := c.All
|
all := c.All
|
||||||
latest := c.Latest
|
latest := c.Latest
|
||||||
|
Reference in New Issue
Block a user