Skip to content

Commit

Permalink
use an AND to define the allocator readiness
Browse files Browse the repository at this point in the history
  • Loading branch information
aojea committed Jun 27, 2024
1 parent fed0517 commit 967ad95
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/registry/core/service/ipallocator/cidrallocator.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,10 @@ func (c *MetaAllocator) syncAllocators() error {
if c.ipFamily != api.IPFamily(convertToV1IPFamily(netutils.IPFamilyOfCIDRString(cidr))) {
continue
}
// the readiness state of an allocator is an OR of all readiness states
ready := true
if !isReady(serviceCIDR) || !serviceCIDR.DeletionTimestamp.IsZero() {
ready = false
// the allocator is ready if the object is ready and is not being deleted
ready := false
if isReady(serviceCIDR) && serviceCIDR.DeletionTimestamp.IsZero() {
ready = true
}

// check if an allocator already exist for this CIDR
Expand Down

0 comments on commit 967ad95

Please sign in to comment.