summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/podman/main.go27
-rw-r--r--cmd/podman/pod_stats.go5
2 files changed, 19 insertions, 13 deletions
diff --git a/cmd/podman/main.go b/cmd/podman/main.go
index ef68ebb2e..1d3db70eb 100644
--- a/cmd/podman/main.go
+++ b/cmd/podman/main.go
@@ -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{
diff --git a/cmd/podman/pod_stats.go b/cmd/podman/pod_stats.go
index 7dbd84525..5c30e0595 100644
--- a/cmd/podman/pod_stats.go
+++ b/cmd/podman/pod_stats.go
@@ -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