diff --git a/daemon/stats/collector.go b/daemon/stats/collector.go index 5f1d84fe4f..4356661c40 100644 --- a/daemon/stats/collector.go +++ b/daemon/stats/collector.go @@ -7,6 +7,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/container" + "github.com/docker/docker/errdefs" "github.com/docker/docker/pkg/pubsub" "github.com/sirupsen/logrus" ) @@ -131,7 +132,7 @@ func (s *Collector) Run() { pair.publisher.Publish(*stats) - case notRunningErr, notFoundErr: + case errdefs.ErrConflict, errdefs.ErrNotFound: // publish empty stats containing only name and ID if not running or not found pair.publisher.Publish(types.StatsJSON{ Name: pair.container.Name, @@ -150,13 +151,3 @@ func (s *Collector) Run() { time.Sleep(s.interval) } } - -type notRunningErr interface { - error - Conflict() -} - -type notFoundErr interface { - error - NotFound() -}