Skip to content

Commit

Permalink
fix: check if resource revision of svc is changed, ignore processing …
Browse files Browse the repository at this point in the history
…if it doesn't (#73)

Signed-off-by: Lin Yang <[email protected]>
  • Loading branch information
reaver-flomesh committed Sep 27, 2023
1 parent b0f6d39 commit 2e2b236
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/controllers/flb/service_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,12 @@ func (r *reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
if flb.IsFLBEnabled(svc, r.fctx.KubeClient) {
log.Debug().Msgf("Type of service %s/%s is LoadBalancer", req.Namespace, req.Name)

oldSvc, found := r.cache[req.NamespacedName]
if found && oldSvc.ResourceVersion == svc.ResourceVersion {
log.Info().Msgf("Service %s/%s hasn't changed or not processed yet, ResourceRevision=%s, skipping ...", req.Namespace, req.Name, svc.ResourceVersion)
return ctrl.Result{}, nil
}

r.cache[req.NamespacedName] = svc.DeepCopy()
mc := r.fctx.Config

Expand Down

0 comments on commit 2e2b236

Please sign in to comment.