diff options
author | openshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com> | 2022-06-14 13:12:17 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-14 13:12:17 +0000 |
commit | 78ecdad5f8f16dbb6146f2741a3d7ead1ce837bc (patch) | |
tree | c6214d1b51693315139277932ee145a51b13a183 /libpod | |
parent | 9fac1b335f681400a029e9d8014f45fa5634ec40 (diff) | |
parent | 608ad7d1139d80093d1ddd933027d31af7fdee83 (diff) | |
download | podman-78ecdad5f8f16dbb6146f2741a3d7ead1ce837bc.tar.gz podman-78ecdad5f8f16dbb6146f2741a3d7ead1ce837bc.tar.bz2 podman-78ecdad5f8f16dbb6146f2741a3d7ead1ce837bc.zip |
Merge pull request #14580 from jakecorrenti/stats-on-non-running-container
Non-running containers now report statistics via the `podman stats`
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/stats.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libpod/stats.go b/libpod/stats.go index 25baa378d..d2ffc3b32 100644 --- a/libpod/stats.go +++ b/libpod/stats.go @@ -34,8 +34,9 @@ func (c *Container) GetContainerStats(previousStats *define.ContainerStats) (*de } } + // returns stats with the fields' default values respective of their type if c.state.State != define.ContainerStateRunning && c.state.State != define.ContainerStatePaused { - return stats, define.ErrCtrStateInvalid + return stats, nil } if previousStats == nil { |