summaryrefslogtreecommitdiff
path: root/cmd/podman/stats.go
diff options
context:
space:
mode:
authorhaircommander <pehunt@redhat.com>2018-08-22 13:13:07 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-23 15:58:08 +0000
commit63dd200e7e47261454c7e55fed2ad972144e147f (patch)
tree3c18d6c844801a5ebaa01e6359c492fd325aef66 /cmd/podman/stats.go
parent3df6332a65b203b8fab106e9856a263f24b956a0 (diff)
downloadpodman-63dd200e7e47261454c7e55fed2ad972144e147f.tar.gz
podman-63dd200e7e47261454c7e55fed2ad972144e147f.tar.bz2
podman-63dd200e7e47261454c7e55fed2ad972144e147f.zip
Changed GetContainerStats to return ErrCtrStateInvalid
This results in some functionality changes: If a ErrCtrStateInvalid is returned to GetPodStats, the container is ommitted from the stats. As such, if an empty slice of Container stats are returned to GetPodStats in varlink, an error will occur. GetContainerStats will return the ErrCtrStateInvalid as well. Finally, if ErrCtrStateInvalid is returned to the podman stats call, the container will be ommitted from the stats. Signed-off-by: haircommander <pehunt@redhat.com> Closes: #1319 Approved by: baude
Diffstat (limited to 'cmd/podman/stats.go')
-rw-r--r--cmd/podman/stats.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/podman/stats.go b/cmd/podman/stats.go
index 6d54147f6..45868e8d7 100644
--- a/cmd/podman/stats.go
+++ b/cmd/podman/stats.go
@@ -138,7 +138,7 @@ func statsCmd(c *cli.Context) error {
id := ctr.ID()
if _, ok := containerStats[ctr.ID()]; !ok {
initialStats, err := ctr.GetContainerStats(&libpod.ContainerStats{})
- if errors.Cause(err) == libpod.ErrCtrRemoved || errors.Cause(err) == libpod.ErrNoSuchCtr {
+ if errors.Cause(err) == libpod.ErrCtrRemoved || errors.Cause(err) == libpod.ErrNoSuchCtr || errors.Cause(err) == libpod.ErrCtrStateInvalid {
// skip dealing with a container that is gone
continue
}