浏览代码

Merge pull request #1404 from sanimej/keys

Reset the encryption keys on swarm leave
Jana Radhakrishnan 9 年之前
父节点
当前提交
9782a0b8d2
共有 2 个文件被更改,包括 6 次插入0 次删除
  1. 3 0
      libnetwork/agent.go
  2. 3 0
      libnetwork/controller.go

+ 3 - 0
libnetwork/agent.go

@@ -328,7 +328,10 @@ func (c *controller) agentClose() {
 	c.agent.epTblCancel()
 
 	c.agent.networkDB.Close()
+
+	c.Lock()
 	c.agent = nil
+	c.Unlock()
 }
 
 func (n *network) isClusterEligible() bool {

+ 3 - 0
libnetwork/controller.go

@@ -307,13 +307,16 @@ func (c *controller) clusterAgentInit() {
 			c.Lock()
 			c.clusterConfigAvailable = false
 			c.agentInitDone = make(chan struct{})
+			c.keys = nil
 			c.Unlock()
 
 			if err := c.ingressSandbox.Delete(); err != nil {
 				log.Warnf("Could not delete ingress sandbox while leaving: %v", err)
 			}
 
+			c.Lock()
 			c.ingressSandbox = nil
+			c.Unlock()
 
 			n, err := c.NetworkByName("ingress")
 			if err != nil {