Skip to content

Commit

Permalink
update alloc logic
Browse files Browse the repository at this point in the history
  • Loading branch information
caribbeantiger committed Sep 11, 2023
1 parent 59000f0 commit 0146b7e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pkg/allocate/allocate.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +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()] == "" {
continue; // IP is reserved without PodRef let ip-reconciler handle it.
} else {
if reserved[ip.String()] != podRef {
continue
if reserved[ip.String()] {
if reserved[ip.String()] == podRef {
logging.Debugf("Found existing reservation %v with matching podRef %s", ip.String(), podRef)
} else {
continue; // IP is reserved without PodRef let ip-reconciler handle it.
}
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 0146b7e

Please sign in to comment.