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:
parent
9bade4d29c
commit
d84f182717
1 changed files with 1 additions and 1 deletions
|
@ -959,7 +959,7 @@ func (n *network) delete(force bool) error {
|
||||||
|
|
||||||
if len(n.loadBalancerIP) != 0 {
|
if len(n.loadBalancerIP) != 0 {
|
||||||
endpoints := n.Endpoints()
|
endpoints := n.Endpoints()
|
||||||
if force || len(endpoints) == 1 {
|
if force || (len(endpoints) == 1 && !n.ingress) {
|
||||||
n.deleteLoadBalancerSandbox()
|
n.deleteLoadBalancerSandbox()
|
||||||
}
|
}
|
||||||
//Reload the network from the store to update the epcnt.
|
//Reload the network from the store to update the epcnt.
|
||||||
|
|
Loading…
Reference in a new issue