1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

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 <ctelfer@docker.com>
This commit is contained in:
Chris Telfer 2018-03-02 14:58:51 -05:00
parent 9bade4d29c
commit d84f182717

View file

@ -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.