From 74fdcb1f4b1b3cd21217d65bc0bbcf01464e9dd9 Mon Sep 17 00:00:00 2001 From: Madhu Venugopal Date: Thu, 9 Jun 2016 16:51:44 -0700 Subject: [PATCH] Handle the case of reseting the Cluster Provider for leave caes Signed-off-by: Madhu Venugopal --- libnetwork/controller.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libnetwork/controller.go b/libnetwork/controller.go index 1c5026f461..0994ec8e8e 100644 --- a/libnetwork/controller.go +++ b/libnetwork/controller.go @@ -218,7 +218,9 @@ func New(cfgOptions ...config.Option) (NetworkController, error) { func (c *controller) SetClusterProvider(provider cluster.Provider) { c.cfg.Daemon.ClusterProvider = provider - go c.clusterAgentInit() + if provider != nil { + go c.clusterAgentInit() + } } func isValidClusteringIP(addr string) bool { @@ -261,6 +263,7 @@ func (c *controller) clusterAgentInit() { } else { c.agentInitDone = make(chan struct{}) c.agentClose() + return } } }