Skip to content

Conversation

@win5923
Copy link
Collaborator

@win5923 win5923 commented Nov 24, 2025

Why are these changes needed?

Similar to #3980. We should directly fail the RayService CR when validation fails, rather than continuously requeueing.

if err := utils.ValidateRayServiceMetadata(rayServiceInstance.ObjectMeta); err != nil {
r.Recorder.Eventf(rayServiceInstance, corev1.EventTypeWarning, string(utils.InvalidRayServiceMetadata),
"The RayService metadata is invalid %s/%s: %v", rayServiceInstance.Namespace, rayServiceInstance.Name, err)
return ctrl.Result{RequeueAfter: ServiceDefaultRequeueDuration}, err
}

Also add new RayServiceConditionReason called RayServiceValidationFailed.

Status:
  Conditions:
    Last Transition Time:  2025-11-24T15:48:50Z
    Message:               The RayService metadata is invalid: RayService name should be no more than 47 characters
    Reason:                ValidationFailed
    Status:                False
    Type:                  Ready
  Last Update Time:        2025-11-24T15:48:50Z

Related issue number

Closes #4045

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

@win5923 win5923 marked this pull request as ready for review November 24, 2025 16:13

// Create a namespace
namespace := test.NewTestNamespace()
rayServiceName := "rayservice-sample-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Can we set the name with strings.Repeat("a", 48) to make it obvious that it exceed 48 characters?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fix in 49c3b45.

@win5923 win5923 force-pushed the rayservice-validation branch from e59fd41 to 49c3b45 Compare November 29, 2025 02:36
@rueian rueian merged commit 8aa4d10 into ray-project:master Dec 1, 2025
27 checks passed
@win5923 win5923 deleted the rayservice-validation branch December 1, 2025 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] RayService not failed when metadata is invalid

6 participants