Skip to content

Commit

Permalink
Don't enqueue VPC update when DeletionTimestamp is zero (#3302)
Browse files Browse the repository at this point in the history
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 <git@kantusch.dev>
  • Loading branch information
sirkrypt0 authored and oilbeater committed Oct 16, 2023
1 parent 408c6e9 commit 29eef27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/controller/vpc.go
Expand Up @@ -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) ||
Expand Down

0 comments on commit 29eef27

Please sign in to comment.