From 6ef2d70760ccf84c392804f845df3c452ef3b3a8 Mon Sep 17 00:00:00 2001 From: Xu Liu Date: Thu, 23 Jan 2025 16:58:21 +0800 Subject: [PATCH] Skip processing Service without IPPool annotation Signed-off-by: Xu Liu --- pkg/controller/serviceexternalip/controller.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/controller/serviceexternalip/controller.go b/pkg/controller/serviceexternalip/controller.go index 48b7d9c1d06..e943e248d3d 100644 --- a/pkg/controller/serviceexternalip/controller.go +++ b/pkg/controller/serviceexternalip/controller.go @@ -155,6 +155,12 @@ func (c *ServiceExternalIPController) enqueueService(obj interface{}) { Namespace: service.Namespace, Name: service.Name, } + + _, allocationExists := c.getExternalIPAllocation(namespacedName) + if !allocationExists && getServiceExternalIPPool(service) == "" { + return + } + c.queue.Add(namespacedName) } @@ -499,7 +505,7 @@ func (c *ServiceExternalIPController) syncService(key apimachinerytypes.Namespac } if currentIPPool == "" { - klog.V(2).InfoS("Ignored Service as required annotation is not found", "service", key) + klog.V(2).InfoS("Ignored Service as the required annotation no longer exists", "service", key) if released { return c.updateServiceLoadBalancerIP(service, nil) }