From 7f57993b5f9225dd8a8fda4aa13e88b14565a170 Mon Sep 17 00:00:00 2001 From: Yifeng Xiao Date: Fri, 23 Aug 2024 13:14:24 +0800 Subject: [PATCH] Fixup reconcile objec being deleted --- .../ipaddressallocation/ipaddressallocation_controller.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/cloudprovider/vsphereparavirtual/controllers/routablepod/ipaddressallocation/ipaddressallocation_controller.go b/pkg/cloudprovider/vsphereparavirtual/controllers/routablepod/ipaddressallocation/ipaddressallocation_controller.go index 024c34438..a3209b17c 100644 --- a/pkg/cloudprovider/vsphereparavirtual/controllers/routablepod/ipaddressallocation/ipaddressallocation_controller.go +++ b/pkg/cloudprovider/vsphereparavirtual/controllers/routablepod/ipaddressallocation/ipaddressallocation_controller.go @@ -239,6 +239,11 @@ func (c *Controller) syncHandler(ctx context.Context, key string) error { return err } + if !ipAddressAllocation.DeletionTimestamp.IsZero() { + logger.V(4).Info(fmt.Sprintf("IPAddressAllocation %s/%s is being deleted, skip", ipAddressAllocation.Namespace, ipAddressAllocation.Name)) + return nil + } + return c.processIPAddressAllocationCreateOrUpdate(ctx, ipAddressAllocation) }