Skip to content

Commit

Permalink
[RayService] Skip update events without change (#811) (#825)
Browse files Browse the repository at this point in the history
Skip RayService reconcile when there is no config/label/annotation change

Signed-off-by: Sihan Wang <[email protected]>
  • Loading branch information
DmitriGekhtman authored Dec 9, 2022
1 parent 7f83353 commit 7374e2c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ray-operator/controllers/ray/rayservice_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/tools/record"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/predicate"

"github.com/ray-project/kuberay/ray-operator/controllers/ray/utils"

Expand Down Expand Up @@ -219,6 +220,7 @@ func (r *RayServiceReconciler) Reconcile(ctx context.Context, request ctrl.Reque
func (r *RayServiceReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
For(&rayv1alpha1.RayService{}).
WithEventFilter(predicate.Or(predicate.GenerationChangedPredicate{}, predicate.LabelChangedPredicate{}, predicate.AnnotationChangedPredicate{})).
Owns(&rayv1alpha1.RayCluster{}).
Owns(&corev1.Service{}).
Owns(&networkingv1.Ingress{}).
Expand Down

0 comments on commit 7374e2c

Please sign in to comment.