From 77a1665c05517194c4d5b27b7e03326d4c0923c9 Mon Sep 17 00:00:00 2001
From: baude <bbaude@redhat.com>
Date: Mon, 9 Apr 2018 08:55:39 -0500
Subject: Containers transitioning to stop should not break stats

When a container is transitioning from running to stopped and stats is runnings,
we should not break stats if we are unable to get stats for that container.

Resolves: #598

Signed-off-by: baude <bbaude@redhat.com>

Closes: #599
Approved by: mheon
---
 cmd/podman/stats.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'cmd')

diff --git a/cmd/podman/stats.go b/cmd/podman/stats.go
index 3c2dfb5cf..6a8681028 100644
--- a/cmd/podman/stats.go
+++ b/cmd/podman/stats.go
@@ -140,7 +140,7 @@ func statsCmd(c *cli.Context) error {
 				containerStats[id] = initialStats
 			}
 			stats, err := ctr.GetContainerStats(containerStats[id])
-			if err != nil {
+			if err != nil && errors.Cause(err) != libpod.ErrNoSuchCtr {
 				return err
 			}
 			// replace the previous measurement with the current one
-- 
cgit v1.2.3-54-g00ecf