Pass check-alive flag on claim for container
This commit is contained in:
1 parent
31a4657467
commit
a0d0b00938
3 files changed
+4
-4
No files matched your search
+2
-2
@@ -51,8 +51,8 @@ func (client *Client) LookupIP(ID string) (*net.IPNet, error) {
|
||||
}
|
||||
|
||||
// Claim a specific IP on behalf of the ID
|
||||
func (client *Client) ClaimIP(ID string, cidr *net.IPNet) error {
|
||||
_, err := client.httpVerb("PUT", fmt.Sprintf("/ip/%s/%s", ID, cidr), nil)
|
||||
func (client *Client) ClaimIP(ID string, cidr *net.IPNet, checkAlive bool) error {
|
||||
_, err := client.httpVerb("PUT", fmt.Sprintf("/ip/%s/%s", ID, cidr), ipamValues(checkAlive))
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ func (i *Ipam) RequestAddress(poolID string, address net.IP, options map[string]
|
||||
}
|
||||
if address != nil { // try to claim specific address requested
|
||||
ip = &net.IPNet{IP: address, Mask: subnet.Mask}
|
||||
if err = i.weave.ClaimIP(api.NoContainerID, ip); err != nil {
|
||||
if err = i.weave.ClaimIP(api.NoContainerID, ip, false); err != nil {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -568,7 +568,7 @@ func (proxy *Proxy) claimCIDR(containerID, cidr string) (*net.IPNet, error) {
|
||||
return nil, err
|
||||
}
|
||||
ipnet.IP = ip // we want the specific IP plus the mask
|
||||
err = proxy.weave.ClaimIP(containerID, ipnet)
|
||||
err = proxy.weave.ClaimIP(containerID, ipnet, true)
|
||||
return ipnet, err
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user