Skip to content

Commit eb654d7

Browse files
committed
Fix: Allow scale to zero during cluster deletion.
1 parent 668f9e2 commit eb654d7

File tree

1 file changed

+4
-0
lines changed
  • ray-operator/controllers/ray/utils

1 file changed

+4
-0
lines changed

ray-operator/controllers/ray/utils/util.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,10 @@ func GetWorkerGroupDesiredReplicas(workerGroupSpec rayv1.WorkerGroupSpec) int32
389389
if workerGroupSpec.Suspend != nil && *workerGroupSpec.Suspend {
390390
return 0
391391
}
392+
//Required to ensure all workers are shutdown when replicas is set to 0 before deleting the raycluster
393+
if workerGroupSpec.Replicas != nil && *workerGroupSpec.Replicas == 0 {
394+
return 0
395+
}
392396
if workerGroupSpec.Replicas == nil || *workerGroupSpec.Replicas < *workerGroupSpec.MinReplicas {
393397
// Replicas is impossible to be nil as it has a default value assigned in the CRD.
394398
// Add this check to make testing easier.

0 commit comments

Comments
 (0)