diff --git a/libnetwork/agent.go b/libnetwork/agent.go index a9d77e2670..f7d57e23a2 100644 --- a/libnetwork/agent.go +++ b/libnetwork/agent.go @@ -378,6 +378,9 @@ func (c *controller) agentClose() { c.agent = nil c.Unlock() + // when the agent is closed the cluster provider should be cleaned up + c.SetClusterProvider(nil) + if agent == nil { return }