From 11a6d1d9bc29ddfaca594de07b194567017dcd6c Mon Sep 17 00:00:00 2001 From: Alessandro Boch Date: Fri, 4 Nov 2016 09:14:35 -0700 Subject: [PATCH] Respect auto allocation for --ipv6 Signed-off-by: Alessandro Boch --- api/api_test.go | 8 ++------ ipam/allocator.go | 2 +- network.go | 3 --- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/api/api_test.go b/api/api_test.go index ab83761239..288ef211ae 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -225,9 +225,7 @@ func TestCreateDeleteNetwork(t *testing.T) { } dops := GetOpsMap("abc", "") - nops := map[string]string{ - netlabel.EnableIPv6: "true", - } + nops := map[string]string{} nc := networkCreate{Name: "network_1", NetworkType: bridgeNetType, DriverOpts: dops, NetworkOpts: nops} goodBody, err := json.Marshal(nc) if err != nil { @@ -1807,9 +1805,7 @@ func TestEndToEnd(t *testing.T) { handleRequest := NewHTTPHandler(c) dops := GetOpsMap("cdef", "1460") - nops := map[string]string{ - netlabel.EnableIPv6: "true", - } + nops := map[string]string{} // Create network nc := networkCreate{Name: "network-fiftyfive", NetworkType: bridgeNetType, DriverOpts: dops, NetworkOpts: nops} diff --git a/ipam/allocator.go b/ipam/allocator.go index 3d69bd9b4f..bd00a14700 100644 --- a/ipam/allocator.go +++ b/ipam/allocator.go @@ -413,7 +413,7 @@ func (a *Allocator) getPredefinedPool(as string, ipV6 bool) (*net.IPNet, error) } } - return nil, types.NotFoundErrorf("could not find an available non-overlapping address pool among the defaults to auto assign to the network") + return nil, types.NotFoundErrorf("could not find an available, non-overlapping IPv%d address pool among the defaults to assign to the network", v) } // RequestAddress returns an address from the specified pool ID diff --git a/network.go b/network.go index d58abdcc65..2fb766627d 100644 --- a/network.go +++ b/network.go @@ -1289,9 +1289,6 @@ func (n *network) ipamAllocateVersion(ipVer int, ipam ipamapi.Ipam) error { } if len(*cfgList) == 0 { - if ipVer == 6 { - return nil - } *cfgList = []*IpamConf{{}} }