From 158b2852b93ae49cb6c74c9a9c676f2d6d3114b4 Mon Sep 17 00:00:00 2001 From: Alessandro Boch Date: Fri, 4 Dec 2015 15:09:59 -0800 Subject: [PATCH] Skip defaultGw check if sandbox is being deleted - On Sandbox deletion, during Leave of each connected endpoint, avoid the default gw check, which may create an unnecessary connection to the default gateway network. Signed-off-by: Alessandro Boch --- libnetwork/endpoint.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnetwork/endpoint.go b/libnetwork/endpoint.go index 050a3b3bde..524287fc8f 100644 --- a/libnetwork/endpoint.go +++ b/libnetwork/endpoint.go @@ -561,7 +561,7 @@ func (ep *endpoint) sbLeave(sbox Sandbox, options ...EndpointOption) error { sb.deleteHostsEntries(n.getSvcRecords(ep)) - if sb.needDefaultGW() { + if !sb.inDelete && sb.needDefaultGW() { ep := sb.getEPwithoutGateway() if ep == nil { return fmt.Errorf("endpoint without GW expected, but not found")