diff --git a/agent.go b/agent.go index c90fa81ff8..29c878e09a 100644 --- a/agent.go +++ b/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 }