Skip to content

Commit 240aa4d

Browse files
committed
address comment
1 parent 24f6ab9 commit 240aa4d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

ray-operator/apis/ray/v1/rayjob_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ const (
8585
SidecarMode JobSubmissionMode = "SidecarMode" // Submit job via a sidecar container in the Ray head Pod
8686
)
8787

88-
type DeletionPolicyType string
89-
9088
// DeletionStrategy defines the deletion policies for a RayJob.
9189
// It allows for fine-grained control over resource cleanup after a job finishes.
9290
//
@@ -167,6 +165,8 @@ type DeletionPolicy struct {
167165
Policy *DeletionPolicyType `json:"policy,omitempty"`
168166
}
169167

168+
type DeletionPolicyType string
169+
170170
const (
171171
DeleteCluster DeletionPolicyType = "DeleteCluster" // To delete the entire RayCluster custom resource on job completion.
172172
DeleteWorkers DeletionPolicyType = "DeleteWorkers" // To delete only the workers on job completion.

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,10 @@ func ValidateRayJobSpec(rayJob *rayv1.RayJob) error {
216216
return fmt.Errorf("backoffLimit must be a positive integer")
217217
}
218218

219-
return validateDeletionStrategy(rayJob)
219+
if err := validateDeletionStrategy(rayJob); err != nil {
220+
return err
221+
}
222+
return nil
220223
}
221224

222225
func ValidateRayServiceMetadata(metadata metav1.ObjectMeta) error {

0 commit comments

Comments
 (0)