فهرست منبع

libnetwork: network.requestPoolHelper: remove dead code

This code was only run if no preferred pool was specified, however,
since [libnetwork#1162][2], the function would already return early
if a preferred pools was set (and the overlap check to be skipped),
so this was now just dead code.

[2]: https://github.com/moby/libnetwork/commit/9cc3385f4421ff00a5b7dfc2d9ad44289aa21c85

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 2 سال پیش
والد
کامیت
67e2c1d482
1فایلهای تغییر یافته به همراه0 افزوده شده و 8 حذف شده
  1. 0 8
      libnetwork/network.go

+ 0 - 8
libnetwork/network.go

@@ -1560,14 +1560,6 @@ func (n *Network) requestPoolHelper(ipam ipamapi.Ipam, addressSpace, requestedPo
 		// when we have either obtained a non-overlapping pool or ran out of
 		// pre-defined pools.
 		tmpPoolLeases = append(tmpPoolLeases, poolID)
-
-		// If this is a preferred pool request and the network
-		// is local scope and there is an overlap, we fail the
-		// network creation right here. The pool will be
-		// released in the defer.
-		if requestedPool != "" {
-			return "", nil, nil, fmt.Errorf("requested subnet %s overlaps in the host", requestedPool)
-		}
 	}
 }