plugins/ipam: round robin ip allocation for host-local ipam

This changes the ip allocation logic to round robin. Before this, host-local IPAM searched for available IPs from start of subnet. Hence it tends to allocate IPs that had been used recently. This is not ideal since it may cause collisions.
This commit is contained in:
Minhan Xia
2016-06-02 11:37:05 -07:00
committed by Stefan Junker
parent 5c3c171642
commit 2445a960a9
8 changed files with 296 additions and 4 deletions

View File

@ -21,6 +21,7 @@ type Store interface {
Unlock() error
Close() error
Reserve(id string, ip net.IP) (bool, error)
LastReservedIP() (net.IP, error)
Release(ip net.IP) error
ReleaseByID(id string) error
}