diff options
Diffstat (limited to 'libpod/pod.go')
-rw-r--r-- | libpod/pod.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libpod/pod.go b/libpod/pod.go index e5d491e52..666480aa8 100644 --- a/libpod/pod.go +++ b/libpod/pod.go @@ -4,6 +4,7 @@ import ( "time" "github.com/containers/storage" + "github.com/pkg/errors" ) // Pod represents a group of containers that are managed together. @@ -192,10 +193,14 @@ func (p *Pod) GetPodStats(previousContainerStats map[string]*ContainerStats) (ma prevStat = &ContainerStats{} } newStats, err := c.GetContainerStats(prevStat) - if err != nil { + // If the container wasn't running, don't include it + // but also suppress the error + if err != nil && errors.Cause(err) != ErrCtrStateInvalid { return nil, err } - newContainerStats[c.ID()] = newStats + if err == nil { + newContainerStats[c.ID()] = newStats + } } return newContainerStats, nil } |