浏览代码

Merge pull request #1410 from mrjana/agent

Avoid k/v store endpoint update in swarm mode
Santhosh Manohar 9 年之前
父节点
当前提交
301e41aff7
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      libnetwork/store.go

+ 8 - 0
libnetwork/store.go

@@ -346,6 +346,10 @@ func (c *controller) networkWatchLoop(nw *netWatch, ep *endpoint, ecCh <-chan da
 }
 
 func (c *controller) processEndpointCreate(nmap map[string]*netWatch, ep *endpoint) {
+	if !c.isDistributedControl() && ep.getNetwork().driverScope() == datastore.GlobalScope {
+		return
+	}
+
 	c.Lock()
 	nw, ok := nmap[ep.getNetwork().ID()]
 	c.Unlock()
@@ -400,6 +404,10 @@ func (c *controller) processEndpointCreate(nmap map[string]*netWatch, ep *endpoi
 }
 
 func (c *controller) processEndpointDelete(nmap map[string]*netWatch, ep *endpoint) {
+	if !c.isDistributedControl() && ep.getNetwork().driverScope() == datastore.GlobalScope {
+		return
+	}
+
 	c.Lock()
 	nw, ok := nmap[ep.getNetwork().ID()]