Skip to content

Commit

Permalink
allocation logic update
Browse files Browse the repository at this point in the history
  • Loading branch information
caribbeantiger committed Sep 11, 2023
1 parent a2cd395 commit 9163494
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/allocate/allocate.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ func IterateForAssignment(ipnet net.IPNet, rangeStart net.IP, rangeEnd net.IP, r
// within ipnet, and make sure that ip is smaller than lastIP.
for ip := firstIP; ipnet.Contains(ip) && iphelpers.CompareIPs(ip, lastIP) <= 0; ip = iphelpers.IncIP(ip) {
// If already reserved, skip it.
if reserved[ip.String()] {
if reserved[ip.String()] == podRef {
logging.Debugf("Found existing reservation %v with matching podRef %s", ip.String(), podRef)
} else {
continue;
}
ref, exist := reserved[ip.String()]
if exist {
if ref != podRef {
continue
}
logging.Debugf("Found existing reservation %v with matching podRef %s", ip.String(), podRef)
}
// If this IP is within the range of one of the excluded subnets, jump to the exluded subnet's broadcast address
// and skip.
Expand Down

0 comments on commit 9163494

Please sign in to comment.