Skip to content

Commit

Permalink
fix: Remove redundant event filter predicates (#1861)
Browse files Browse the repository at this point in the history
  • Loading branch information
c-pius authored Sep 12, 2024
1 parent 506706a commit fdb12be
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions internal/controller/kyma/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,13 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager, opts ctrlruntime.Options
if err := mgr.Add(runnableListener); err != nil {
return fmt.Errorf("KymaReconciler %w", err)
}
predicates := predicate.Or(predicate.GenerationChangedPredicate{}, predicate.LabelChangedPredicate{})
if err := ctrl.NewControllerManagedBy(mgr).For(&v1beta2.Kyma{}).
Named(controllerName).
WithOptions(opts).
WithEventFilter(predicates).
WithEventFilter(predicate.Or(predicate.GenerationChangedPredicate{}, predicate.LabelChangedPredicate{})).
Watches(&v1beta2.ModuleTemplate{},
handler.EnqueueRequestsFromMapFunc(watch.NewTemplateChangeHandler(r).Watch()),
builder.WithPredicates(predicates)).
Watches(&apicorev1.Secret{}, handler.Funcs{}, builder.WithPredicates(predicates)).
handler.EnqueueRequestsFromMapFunc(watch.NewTemplateChangeHandler(r).Watch())).
Watches(&apicorev1.Secret{}, handler.Funcs{}).
Watches(&v1beta2.Manifest{},
handler.EnqueueRequestForOwner(mgr.GetScheme(), mgr.GetRESTMapper(), &v1beta2.Kyma{},
handler.OnlyControllerOwner()), builder.WithPredicates(predicate.ResourceVersionChangedPredicate{})).
Expand Down

0 comments on commit fdb12be

Please sign in to comment.