From 29eef2778c1542e3e460051b4c19d30e9057c4b0 Mon Sep 17 00:00:00 2001 From: Tobias <22522058+sirkrypt0@users.noreply.github.com> Date: Mon, 16 Oct 2023 11:44:39 +0200 Subject: [PATCH] Don't enqueue VPC update when DeletionTimestamp is zero (#3302) We change the check to not enqueue a VPC update when the DeletionTimestamp is zero. Previously, the VPC update would basically always be enqueued, as the DeletionTimestamp would be zero until it was scheduled for deletion. This lead to a huge amount of enqueued VPC updates and therefore a lot of Kubernetes API requests and load on the API. The logical not was removed in #3107 which therefore introduced this bug. Signed-off-by: Tobias Kantusch --- pkg/controller/vpc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controller/vpc.go b/pkg/controller/vpc.go index f27e4e72c6e..fa837b13f57 100644 --- a/pkg/controller/vpc.go +++ b/pkg/controller/vpc.go @@ -44,7 +44,7 @@ func (c *Controller) enqueueUpdateVpc(oldObj, newObj interface{}) { oldVpc := oldObj.(*kubeovnv1.Vpc) newVpc := newObj.(*kubeovnv1.Vpc) - if newVpc.DeletionTimestamp.IsZero() || + if !newVpc.DeletionTimestamp.IsZero() || !reflect.DeepEqual(oldVpc.Spec.Namespaces, newVpc.Spec.Namespaces) || !reflect.DeepEqual(oldVpc.Spec.StaticRoutes, newVpc.Spec.StaticRoutes) || !reflect.DeepEqual(oldVpc.Spec.PolicyRoutes, newVpc.Spec.PolicyRoutes) ||