@@ -193,7 +193,7 @@ func (r *RayClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request)
193
193
}
194
194
}
195
195
196
- if cluster . Status . State != "suspended" && isRayDashboardOAuthEnabled (r .Config ) && r .IsOpenShift {
196
+ if ! isRayClusterSuspended ( cluster ) && isRayDashboardOAuthEnabled (r .Config ) && r .IsOpenShift {
197
197
logger .Info ("Creating OAuth Objects" )
198
198
_ , err := r .routeClient .Routes (cluster .Namespace ).Apply (ctx , desiredClusterRoute (cluster ), metav1.ApplyOptions {FieldManager : controllerName , Force : true })
199
199
if err != nil {
@@ -239,7 +239,7 @@ func (r *RayClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request)
239
239
return ctrl.Result {RequeueAfter : requeueTime }, err
240
240
}
241
241
242
- } else if cluster . Status . State != "suspended" && ! isRayDashboardOAuthEnabled (r .Config ) && ! r .IsOpenShift {
242
+ } else if ! isRayClusterSuspended ( cluster ) && ! isRayDashboardOAuthEnabled (r .Config ) && ! r .IsOpenShift {
243
243
logger .Info ("We detected being on Vanilla Kubernetes!" )
244
244
logger .Info ("Creating Dashboard Ingress" )
245
245
dashboardName := dashboardNameFromCluster (cluster )
@@ -312,6 +312,10 @@ func isMTLSEnabled(cfg *config.KubeRayConfiguration) bool {
312
312
return cfg == nil || ptr .Deref (cfg .MTLSEnabled , true )
313
313
}
314
314
315
+ func isRayClusterSuspended (cluster * rayv1.RayCluster ) bool {
316
+ return cluster .Spec .Suspend != nil && ptr .Deref (cluster .Spec .Suspend , false )
317
+ }
318
+
315
319
func crbNameFromCluster (cluster * rayv1.RayCluster ) string {
316
320
if shouldUseOldName (cluster ) {
317
321
return cluster .Name + "-" + cluster .Namespace + "-auth"
0 commit comments