Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

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 (#315)

* fix: check if resource revision of svc is changed, ignore processing if it doesn't

Signed-off-by: Lin Yang <[email protected]>

* chore: prepare release v0.2.11-alpha.1

Signed-off-by: Lin Yang <[email protected]>

---------

Signed-off-by: Lin Yang <[email protected]>
  • Loading branch information
reaver-flomesh authored Sep 26, 2023
1 parent f8fd9ae commit 0cb23b9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions controllers/flb/service_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,12 @@ func (r *ServiceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
if flb.IsFlbEnabled(svc, r.K8sAPI) {
klog.V(5).Infof("Type of service %s/%s is LoadBalancer", req.Namespace, req.Name)

oldSvc, found := r.cache[req.NamespacedName]
if found && oldSvc.ResourceVersion == svc.ResourceVersion {
klog.V(5).Infof("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.ControlPlaneConfigStore.MeshConfig.GetConfig()

Expand Down

0 comments on commit 0cb23b9

Please sign in to comment.