Skip to content

Commit

Permalink
only have ResourceVersionChangedPredicate for Manifest CR
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanxin committed Aug 26, 2024
1 parent 817cf4a commit 70f60eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/controller/kyma/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ 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(predicate.Or(predicate.GenerationChangedPredicate{}, predicate.LabelChangedPredicate{})).
Watches(&v1beta2.ModuleTemplate{},
handler.EnqueueRequestsFromMapFunc(watch.NewTemplateChangeHandler(r).Watch())).
Watches(&apicorev1.Secret{}, handler.Funcs{}).
handler.EnqueueRequestsFromMapFunc(watch.NewTemplateChangeHandler(r).Watch()),
builder.WithPredicates(predicates)).
Watches(&apicorev1.Secret{}, handler.Funcs{}, builder.WithPredicates(predicates)).
Watches(&v1beta2.Manifest{},
handler.EnqueueRequestForOwner(mgr.GetScheme(), mgr.GetRESTMapper(), &v1beta2.Kyma{},
handler.OnlyControllerOwner()), builder.WithPredicates(predicate.ResourceVersionChangedPredicate{})).
Expand Down

0 comments on commit 70f60eb

Please sign in to comment.