Skip to content

Commit

Permalink
Merge pull request #1538 from aboch/06
Browse files Browse the repository at this point in the history
Respect auto allocation for --ipv6
  • Loading branch information
Santhosh Manohar authored Nov 16, 2016
2 parents e5870cb + 11a6d1d commit 3425e1c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
8 changes: 2 additions & 6 deletions api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion ipam/allocator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions network.go
Original file line number Diff line number Diff line change
Expand Up @@ -1303,9 +1303,6 @@ func (n *network) ipamAllocateVersion(ipVer int, ipam ipamapi.Ipam) error {
}

if len(*cfgList) == 0 {
if ipVer == 6 {
return nil
}
*cfgList = []*IpamConf{{}}
}

Expand Down

0 comments on commit 3425e1c

Please sign in to comment.