From e52abafc48b9967984087c49f39be2479ae60693 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Sat, 20 Feb 2016 10:59:47 +0000 Subject: [PATCH] treat restarting containers as "not running" thus preventing stale DNS & IPAM entries. Fixes #1977 --- common/docker/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/docker/client.go b/common/docker/client.go index 86cb9dd7..dabf3aec 100644 --- a/common/docker/client.go +++ b/common/docker/client.go @@ -97,7 +97,7 @@ func (c *Client) AddObserver(ob ContainerObserver) error { func (c *Client) IsContainerNotRunning(idStr string) bool { container, err := c.InspectContainer(idStr) if err == nil { - return !container.State.Running + return !container.State.Running || container.State.Restarting } if _, notThere := err.(*docker.NoSuchContainer); notThere { return true