Skip to content

Commit 2f8ee7f

Browse files
authored
[RayService] Setting observedGeneration inside calculateStatus (#2869)
Signed-off-by: kaihsun <[email protected]>
1 parent c13949e commit 2f8ee7f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ray-operator/controllers/ray/rayservice_controller.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,6 @@ func (r *RayServiceReconciler) Reconcile(ctx context.Context, request ctrl.Reque
126126
return ctrl.Result{}, err
127127
}
128128

129-
// TODO (kevin85421): ObservedGeneration should be used to determine whether to update this CR or not.
130-
rayServiceInstance.Status.ObservedGeneration = rayServiceInstance.ObjectMeta.Generation
131-
132129
// Find active and pending ray cluster objects given current service name.
133130
var activeRayClusterInstance, pendingRayClusterInstance *rayv1.RayCluster
134131
if activeRayClusterInstance, pendingRayClusterInstance, err = r.reconcileRayCluster(ctx, rayServiceInstance); err != nil {
@@ -229,6 +226,8 @@ func (r *RayServiceReconciler) reconcileServicesToReadyCluster(ctx context.Conte
229226
func (r *RayServiceReconciler) calculateStatus(ctx context.Context, rayServiceInstance *rayv1.RayService, headSvc, serveSvc *corev1.Service, activeCluster, pendingCluster *rayv1.RayCluster, activeClusterServeApplications, pendingClusterServeApplications map[string]rayv1.AppStatus) error {
230227
logger := ctrl.LoggerFrom(ctx)
231228

229+
rayServiceInstance.Status.ObservedGeneration = rayServiceInstance.ObjectMeta.Generation
230+
232231
// Update RayClusterStatus in RayService status.
233232
var activeClusterStatus, pendingClusterStatus rayv1.RayClusterStatus
234233
if activeCluster != nil {

0 commit comments

Comments
 (0)