From 967ad95b530cb6e4170c8fc8a2282f7aeedcc751 Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Thu, 27 Jun 2024 11:39:36 +0000 Subject: [PATCH] use an AND to define the allocator readiness --- pkg/registry/core/service/ipallocator/cidrallocator.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/registry/core/service/ipallocator/cidrallocator.go b/pkg/registry/core/service/ipallocator/cidrallocator.go index 1d02e86f59e..41be1b9a969 100644 --- a/pkg/registry/core/service/ipallocator/cidrallocator.go +++ b/pkg/registry/core/service/ipallocator/cidrallocator.go @@ -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