mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #902 from bboreham/not-preferred
Stop referring to requested IP address as "preferred"
This commit is contained in:
commit
2b105e3610
5 changed files with 6 additions and 6 deletions
|
@ -41,7 +41,7 @@ type Ipam interface {
|
||||||
RequestPool(addressSpace, pool, subPool string, options map[string]string, v6 bool) (string, *net.IPNet, map[string]string, error)
|
RequestPool(addressSpace, pool, subPool string, options map[string]string, v6 bool) (string, *net.IPNet, map[string]string, error)
|
||||||
// ReleasePool releases the address pool identified by the passed id
|
// ReleasePool releases the address pool identified by the passed id
|
||||||
ReleasePool(poolID string) error
|
ReleasePool(poolID string) error
|
||||||
// Request address from the specified pool ID. Input options or preferred IP can be passed.
|
// Request address from the specified pool ID. Input options or required IP can be passed.
|
||||||
RequestAddress(string, net.IP, map[string]string) (*net.IPNet, map[string]string, error)
|
RequestAddress(string, net.IP, map[string]string) (*net.IPNet, map[string]string, error)
|
||||||
// Release the address from the specified pool ID
|
// Release the address from the specified pool ID
|
||||||
ReleaseAddress(string, net.IP) error
|
ReleaseAddress(string, net.IP) error
|
||||||
|
@ -215,7 +215,7 @@ For this API, the remote driver will receive a POST message to the URL `/IpamDri
|
||||||
Where:
|
Where:
|
||||||
|
|
||||||
* `PoolID` is the pool identifier
|
* `PoolID` is the pool identifier
|
||||||
* `Address` is the preferred address in regular IP form (A.B.C.D). If empty, the IPAM driver chooses any available address on the pool
|
* `Address` is the required address in regular IP form (A.B.C.D). If this address cannot be satisfied, the request fails. If empty, the IPAM driver chooses any available address on the pool
|
||||||
* `Options` are IPAM driver specific options
|
* `Options` are IPAM driver specific options
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -911,7 +911,7 @@ func (ep *endpoint) assignAddressVersion(ipVer int, ipam ipamapi.Ipam) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if progAdd != nil {
|
if progAdd != nil {
|
||||||
return types.BadRequestErrorf("Invalid preferred address %s: It does not belong to any of this network's subnets", prefAdd)
|
return types.BadRequestErrorf("Invalid address %s: It does not belong to any of this network's subnets", prefAdd)
|
||||||
}
|
}
|
||||||
return fmt.Errorf("no available IPv%d addresses on this network's address pools: %s (%s)", ipVer, n.Name(), n.ID())
|
return fmt.Errorf("no available IPv%d addresses on this network's address pools: %s (%s)", ipVer, n.Name(), n.ID())
|
||||||
}
|
}
|
||||||
|
|
|
@ -489,7 +489,7 @@ func (a *Allocator) getAddress(nw *net.IPNet, bitmask *bitseq.Handle, prefAddres
|
||||||
} else if prefAddress != nil {
|
} else if prefAddress != nil {
|
||||||
hostPart, e := types.GetHostPartIP(prefAddress, base.Mask)
|
hostPart, e := types.GetHostPartIP(prefAddress, base.Mask)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
return nil, types.InternalErrorf("failed to allocate preferred address %s: %v", prefAddress.String(), e)
|
return nil, types.InternalErrorf("failed to allocate requested address %s: %v", prefAddress.String(), e)
|
||||||
}
|
}
|
||||||
ordinal = ipToUint64(types.GetMinimalIP(hostPart))
|
ordinal = ipToUint64(types.GetMinimalIP(hostPart))
|
||||||
err = bitmask.Set(ordinal)
|
err = bitmask.Set(ordinal)
|
||||||
|
|
|
@ -773,7 +773,7 @@ func TestRequestSyntaxCheck(t *testing.T) {
|
||||||
ip := net.ParseIP("172.17.0.23")
|
ip := net.ParseIP("172.17.0.23")
|
||||||
_, _, err = a.RequestAddress(pid, ip, nil)
|
_, _, err = a.RequestAddress(pid, ip, nil)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Fatalf("Failed to detect wrong request: preferred IP from different subnet")
|
t.Fatalf("Failed to detect wrong request: requested IP from different subnet")
|
||||||
}
|
}
|
||||||
|
|
||||||
ip = net.ParseIP("192.168.0.50")
|
ip = net.ParseIP("192.168.0.50")
|
||||||
|
|
|
@ -67,7 +67,7 @@ type Ipam interface {
|
||||||
RequestPool(addressSpace, pool, subPool string, options map[string]string, v6 bool) (string, *net.IPNet, map[string]string, error)
|
RequestPool(addressSpace, pool, subPool string, options map[string]string, v6 bool) (string, *net.IPNet, map[string]string, error)
|
||||||
// ReleasePool releases the address pool identified by the passed id
|
// ReleasePool releases the address pool identified by the passed id
|
||||||
ReleasePool(poolID string) error
|
ReleasePool(poolID string) error
|
||||||
// Request address from the specified pool ID. Input options or preferred IP can be passed.
|
// Request address from the specified pool ID. Input options or required IP can be passed.
|
||||||
RequestAddress(string, net.IP, map[string]string) (*net.IPNet, map[string]string, error)
|
RequestAddress(string, net.IP, map[string]string) (*net.IPNet, map[string]string, error)
|
||||||
// Release the address from the specified pool ID
|
// Release the address from the specified pool ID
|
||||||
ReleaseAddress(string, net.IP) error
|
ReleaseAddress(string, net.IP) error
|
||||||
|
|
Loading…
Add table
Reference in a new issue