-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RayJob] Follow up of RayJob deletion policy PR #2763
Conversation
Signed-off-by: kaihsun <[email protected]>
@@ -321,15 +321,15 @@ func TestUpdateRayJobStatus(t *testing.T) { | |||
|
|||
func TestValidateRayJobSpec(t *testing.T) { | |||
err := validateRayJobSpec(&rayv1.RayJob{}) | |||
assert.Error(t, err, "The RayJob is invalid because both `RayClusterSpec` and `ClusterSelector` are empty") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several subtests don't return the error from the validation rule we want to test, so I use ErrorContains
instead.
@@ -896,6 +885,10 @@ func validateRayJobSpec(rayJob *rayv1.RayJob) error { | |||
if rayJob.Spec.Suspend && !rayJob.Spec.ShutdownAfterJobFinishes { | |||
return fmt.Errorf("a RayJob with shutdownAfterJobFinishes set to false is not allowed to be suspended") | |||
} | |||
if rayJob.Spec.Suspend && rayJob.Spec.DeletionPolicy != nil && *rayJob.Spec.DeletionPolicy != rayv1.DeleteClusterDeletionPolicy { | |||
// This is a restriction for Kueue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it safe to assume that Kueue is the only consumer of the suspend API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, Kueue has it's own validation webhook https://github.com/kubernetes-sigs/kueue/blob/main/pkg/controller/jobs/rayjob/rayjob_webhook.go#L93-L136
Putting the validation check there is probably safer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting the validation check there is probably safer
makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed the check
Signed-off-by: kaihsun <[email protected]>
Why are these changes needed?
Related issue number
Checks