From b76d00e02095fae8043bebdf92e08d6efbfc97b1 Mon Sep 17 00:00:00 2001 From: Alexey Kazakov Date: Fri, 19 Jul 2024 15:13:55 -0700 Subject: [PATCH] predicate --- controllers/nstemplateset/nstemplateset_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/nstemplateset/nstemplateset_controller.go b/controllers/nstemplateset/nstemplateset_controller.go index 7accbc78..a237a1d9 100644 --- a/controllers/nstemplateset/nstemplateset_controller.go +++ b/controllers/nstemplateset/nstemplateset_controller.go @@ -57,7 +57,7 @@ func (r *Reconciler) SetupWithManager(mgr manager.Manager, allNamespaceCluster r mapToOwnerByLabel := handler.EnqueueRequestsFromMapFunc(commoncontroller.MapToOwnerByLabel("", toolchainv1alpha1.SpaceLabelKey)) build := ctrl.NewControllerManagedBy(mgr). - For(&toolchainv1alpha1.NSTemplateSet{}, builder.WithPredicates(predicate.GenerationChangedPredicate{})). + For(&toolchainv1alpha1.NSTemplateSet{}, builder.WithPredicates(predicate.GenerationChangedPredicate{}, predicate.AnnotationChangedPredicate{})). Watches(&source.Kind{Type: &corev1.Namespace{}}, mapToOwnerByLabel). Watches(source.NewKindWithCache(&rbac.Role{}, allNamespaceCluster.GetCache()), mapToOwnerByLabel, builder.WithPredicates(commonpredicates.LabelsAndGenerationPredicate{})). Watches(source.NewKindWithCache(&rbac.RoleBinding{}, allNamespaceCluster.GetCache()), mapToOwnerByLabel, builder.WithPredicates(commonpredicates.LabelsAndGenerationPredicate{}))