diff --git a/internal/provider/kubernetes/controller.go b/internal/provider/kubernetes/controller.go index 50ef85a9cb8..7a72b0a49c4 100644 --- a/internal/provider/kubernetes/controller.go +++ b/internal/provider/kubernetes/controller.go @@ -1295,16 +1295,16 @@ func (r *gatewayAPIReconciler) watchResources(ctx context.Context, mgr manager.M if err := c.Watch( source.Kind(mgr.GetCache(), &gwapiv1b1.GatewayClass{}), handler.EnqueueRequestsFromMapFunc(r.enqueueClass), - predicate.NewPredicateFuncs(r.hasMatchingController), predicate.GenerationChangedPredicate{}, + predicate.NewPredicateFuncs(r.hasMatchingController), ); err != nil { return err } // Only enqueue EnvoyProxy objects that match this Envoy Gateway's GatewayClass. epPredicates := []predicate.Predicate{ - predicate.ResourceVersionChangedPredicate{}, predicate.GenerationChangedPredicate{}, + predicate.ResourceVersionChangedPredicate{}, predicate.NewPredicateFuncs(r.hasManagedClass), } if len(r.namespaceLabels) != 0 { @@ -1320,8 +1320,8 @@ func (r *gatewayAPIReconciler) watchResources(ctx context.Context, mgr manager.M // Watch Gateway CRUDs and reconcile affected GatewayClass. gPredicates := []predicate.Predicate{ - predicate.NewPredicateFuncs(r.validateGatewayForReconcile), predicate.GenerationChangedPredicate{}, + predicate.NewPredicateFuncs(r.validateGatewayForReconcile), } if len(r.namespaceLabels) != 0 { gPredicates = append(gPredicates, predicate.NewPredicateFuncs(r.hasMatchingNamespaceLabels)) @@ -1419,8 +1419,8 @@ func (r *gatewayAPIReconciler) watchResources(ctx context.Context, mgr manager.M // Watch Service CRUDs and process affected *Route objects. servicePredicates := []predicate.Predicate{ - predicate.NewPredicateFuncs(r.validateServiceForReconcile), predicate.GenerationChangedPredicate{}, + predicate.NewPredicateFuncs(r.validateServiceForReconcile), } if len(r.namespaceLabels) != 0 { servicePredicates = append(servicePredicates, predicate.NewPredicateFuncs(r.hasMatchingNamespaceLabels)) @@ -1443,6 +1443,7 @@ func (r *gatewayAPIReconciler) watchResources(ctx context.Context, mgr manager.M if err := c.Watch( source.Kind(mgr.GetCache(), &mcsapi.ServiceImport{}), handler.EnqueueRequestsFromMapFunc(r.enqueueClass), + predicate.GenerationChangedPredicate{}, predicate.NewPredicateFuncs(r.validateServiceImportForReconcile)); err != nil { // ServiceImport is not available in the cluster, skip the watch and not throw error. r.log.Info("unable to watch ServiceImport: %s", err.Error()) @@ -1465,8 +1466,8 @@ func (r *gatewayAPIReconciler) watchResources(ctx context.Context, mgr manager.M // Watch Node CRUDs to update Gateway Address exposed by Service of type NodePort. // Node creation/deletion and ExternalIP updates would require update in the Gateway nPredicates := []predicate.Predicate{ - predicate.NewPredicateFuncs(r.handleNode), predicate.GenerationChangedPredicate{}, + predicate.NewPredicateFuncs(r.handleNode), } if len(r.namespaceLabels) != 0 { nPredicates = append(nPredicates, predicate.NewPredicateFuncs(r.hasMatchingNamespaceLabels)) @@ -1482,8 +1483,8 @@ func (r *gatewayAPIReconciler) watchResources(ctx context.Context, mgr manager.M // Watch Secret CRUDs and process affected Gateways. secretPredicates := []predicate.Predicate{ - predicate.NewPredicateFuncs(r.validateSecretForReconcile), predicate.GenerationChangedPredicate{}, + predicate.NewPredicateFuncs(r.validateSecretForReconcile), } if len(r.namespaceLabels) != 0 { secretPredicates = append(secretPredicates, predicate.NewPredicateFuncs(r.hasMatchingNamespaceLabels)) @@ -1530,8 +1531,8 @@ func (r *gatewayAPIReconciler) watchResources(ctx context.Context, mgr manager.M // Watch AuthenticationFilter CRUDs and enqueue associated HTTPRoute objects. afPredicates := []predicate.Predicate{ - predicate.NewPredicateFuncs(r.httpRoutesForAuthenticationFilter), predicate.GenerationChangedPredicate{}, + predicate.NewPredicateFuncs(r.httpRoutesForAuthenticationFilter), } if len(r.namespaceLabels) != 0 { afPredicates = append(afPredicates, predicate.NewPredicateFuncs(r.hasMatchingNamespaceLabels))