Browse Source

Merge pull request #1233 from mavenugo/ag

Handle the case of reseting the Cluster Provider for leave caes
Jana Radhakrishnan 9 năm trước cách đây
mục cha
commit
5ad7c23e92
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  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
 			}
 		}
 	}