diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-08-20 16:57:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-20 16:57:55 +0200 |
commit | 230faa864f8922f16a0d70c4a3454d51768e9a15 (patch) | |
tree | 4e6f9e0d5436e0bc8f484b7a33e48dc3a8d67216 /cmd/podman | |
parent | 34fc1d09d245cbd0d922562860f639667c8641d6 (diff) | |
parent | 539b7b6058a1b034e7b982dec3a822e024a24d54 (diff) | |
download | podman-230faa864f8922f16a0d70c4a3454d51768e9a15.tar.gz podman-230faa864f8922f16a0d70c4a3454d51768e9a15.tar.bz2 podman-230faa864f8922f16a0d70c4a3454d51768e9a15.zip |
Merge pull request #3569 from rhatdan/cgroupsv1
Fix error message on podman stats on cgroups v1 rootless environments
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/stats.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/podman/stats.go b/cmd/podman/stats.go index 2f696445e..25514ec75 100644 --- a/cmd/podman/stats.go +++ b/cmd/podman/stats.go @@ -134,9 +134,13 @@ func statsCmd(c *cliconfig.StatsValues) error { initialStats, err := ctr.GetContainerStats(&libpod.ContainerStats{}) if err != nil { // when doing "all", dont worry about containers that are not running - if c.All && errors.Cause(err) == define.ErrCtrRemoved || errors.Cause(err) == define.ErrNoSuchCtr || errors.Cause(err) == define.ErrCtrStateInvalid { + cause := errors.Cause(err) + if c.All && (cause == define.ErrCtrRemoved || cause == define.ErrNoSuchCtr || cause == define.ErrCtrStateInvalid) { continue } + if cause == cgroups.ErrCgroupV1Rootless { + err = cause + } return err } containerStats[ctr.ID()] = initialStats |