@@ -193,7 +193,7 @@ func (r *RayClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request)
193193 }
194194 }
195195
196- if cluster . Status . State != "suspended" && isRayDashboardOAuthEnabled (r .Config ) && r .IsOpenShift {
196+ if ! isRayClusterSuspended ( cluster ) && isRayDashboardOAuthEnabled (r .Config ) && r .IsOpenShift {
197197 logger .Info ("Creating OAuth Objects" )
198198 _ , err := r .routeClient .Routes (cluster .Namespace ).Apply (ctx , desiredClusterRoute (cluster ), metav1.ApplyOptions {FieldManager : controllerName , Force : true })
199199 if err != nil {
@@ -239,7 +239,7 @@ func (r *RayClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request)
239239 return ctrl.Result {RequeueAfter : requeueTime }, err
240240 }
241241
242- } else if cluster . Status . State != "suspended" && ! isRayDashboardOAuthEnabled (r .Config ) && ! r .IsOpenShift {
242+ } else if ! isRayClusterSuspended ( cluster ) && ! isRayDashboardOAuthEnabled (r .Config ) && ! r .IsOpenShift {
243243 logger .Info ("We detected being on Vanilla Kubernetes!" )
244244 logger .Info ("Creating Dashboard Ingress" )
245245 dashboardName := dashboardNameFromCluster (cluster )
@@ -312,6 +312,10 @@ func isMTLSEnabled(cfg *config.KubeRayConfiguration) bool {
312312 return cfg == nil || ptr .Deref (cfg .MTLSEnabled , true )
313313}
314314
315+ func isRayClusterSuspended (cluster * rayv1.RayCluster ) bool {
316+ return cluster .Spec .Suspend != nil && ptr .Deref (cluster .Spec .Suspend , false )
317+ }
318+
315319func crbNameFromCluster (cluster * rayv1.RayCluster ) string {
316320 if shouldUseOldName (cluster ) {
317321 return cluster .Name + "-" + cluster .Namespace + "-auth"
0 commit comments