Просмотр исходного кода

Merge pull request #1701 from aboch/clri

Do not clear ingress network in libnetwork
Santhosh Manohar 8 лет назад
Родитель
Сommit
c3036bcc36
1 измененных файлов с 0 добавлено и 42 удалено
  1. 0 42
      libnetwork/controller.go

+ 0 - 42
libnetwork/controller.go

@@ -337,9 +337,6 @@ func (c *controller) clusterAgentInit() {
 			// service bindings
 			// service bindings
 			c.agentClose()
 			c.agentClose()
 			c.cleanupServiceBindings("")
 			c.cleanupServiceBindings("")
-
-			c.clearIngress(true)
-
 			return
 			return
 		}
 		}
 	}
 	}
@@ -1153,46 +1150,7 @@ func (c *controller) getIPAMDriver(name string) (ipamapi.Ipam, *ipamapi.Capabili
 }
 }
 
 
 func (c *controller) Stop() {
 func (c *controller) Stop() {
-	c.clearIngress(false)
 	c.closeStores()
 	c.closeStores()
 	c.stopExternalKeyListener()
 	c.stopExternalKeyListener()
 	osl.GC()
 	osl.GC()
 }
 }
-
-func (c *controller) clearIngress(clusterLeave bool) {
-	c.Lock()
-	ingressSandbox := c.ingressSandbox
-	c.ingressSandbox = nil
-	c.Unlock()
-
-	var n *network
-	if ingressSandbox != nil {
-		for _, ep := range ingressSandbox.getConnectedEndpoints() {
-			if nw := ep.getNetwork(); nw.ingress {
-				n = nw
-				break
-			}
-		}
-		if err := ingressSandbox.Delete(); err != nil {
-			logrus.Warnf("Could not delete ingress sandbox while leaving: %v", err)
-		}
-	}
-
-	if n == nil {
-		for _, nw := range c.Networks() {
-			if nw.Info().Ingress() {
-				n = nw.(*network)
-				break
-			}
-		}
-	}
-	if n == nil && clusterLeave {
-		logrus.Warnf("Could not find ingress network while leaving")
-	}
-
-	if n != nil {
-		if err := n.Delete(); err != nil {
-			logrus.Warnf("Could not delete ingress network while leaving: %v", err)
-		}
-	}
-}