From d84f18271771fa470bbab0ca4d2c4d4ad96ebc0d Mon Sep 17 00:00:00 2001 From: Chris Telfer Date: Fri, 2 Mar 2018 14:58:51 -0500 Subject: [PATCH] Prevent ingress deletion when endpoint count == 1 We should not delete an ingress network just because its endpoint count drops to 1 (the IP address of the sandbox). This addresses a regression where the ingress sandbox could be deleted on workers when the last container leave said sandbox. Signed-off-by: Chris Telfer --- libnetwork/network.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnetwork/network.go b/libnetwork/network.go index 70c55844f1..e283d65815 100644 --- a/libnetwork/network.go +++ b/libnetwork/network.go @@ -959,7 +959,7 @@ func (n *network) delete(force bool) error { if len(n.loadBalancerIP) != 0 { endpoints := n.Endpoints() - if force || len(endpoints) == 1 { + if force || (len(endpoints) == 1 && !n.ingress) { n.deleteLoadBalancerSandbox() } //Reload the network from the store to update the epcnt.