Kaynağa Gözat

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 <aboch@docker.com>
Alessandro Boch 9 yıl önce
ebeveyn
işleme
158b2852b9
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      libnetwork/endpoint.go

+ 1 - 1
libnetwork/endpoint.go

@@ -561,7 +561,7 @@ func (ep *endpoint) sbLeave(sbox Sandbox, options ...EndpointOption) error {
 
 
 	sb.deleteHostsEntries(n.getSvcRecords(ep))
 	sb.deleteHostsEntries(n.getSvcRecords(ep))
 
 
-	if sb.needDefaultGW() {
+	if !sb.inDelete && sb.needDefaultGW() {
 		ep := sb.getEPwithoutGateway()
 		ep := sb.getEPwithoutGateway()
 		if ep == nil {
 		if ep == nil {
 			return fmt.Errorf("endpoint without GW expected, but not found")
 			return fmt.Errorf("endpoint without GW expected, but not found")