瀏覽代碼

Merge pull request #1162 from aboch/fx2

Do not perform the overlap check on user chosen pool
Madhu Venugopal 9 年之前
父節點
當前提交
0de68331ab
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. 3 4
      libnetwork/network.go

+ 3 - 4
libnetwork/network.go

@@ -1123,10 +1123,9 @@ func (n *network) requestPoolHelper(ipam ipamapi.Ipam, addressSpace, preferredPo
 			return "", nil, nil, err
 			return "", nil, nil, err
 		}
 		}
 
 
-		// If the network belongs to global scope or the pool
-		// returned is invalid, no need to perform overlap
-		// check.
-		if n.Scope() == datastore.GlobalScope || !types.IsIPNetValid(pool) {
+		// If the network belongs to global scope or the pool was
+		// explicitely chosen or it is invalid, do not perform the overlap check.
+		if n.Scope() == datastore.GlobalScope || preferredPool != "" || !types.IsIPNetValid(pool) {
 			return poolID, pool, meta, nil
 			return poolID, pool, meta, nil
 		}
 		}