Browse Source

Merge pull request #1233 from mavenugo/ag

Handle the case of reseting the Cluster Provider for leave caes
Jana Radhakrishnan 9 years ago
parent
commit
5ad7c23e92
1 changed files with 4 additions and 1 deletions
  1. 4 1
      libnetwork/controller.go

+ 4 - 1
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
 			}
 		}
 	}