-
Notifications
You must be signed in to change notification settings - Fork 416
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
[Feature] Add ManagedBy field #2589
base: master
Are you sure you want to change the base?
Conversation
// the field value is the reserved string 'ray.io/kuberay-operator', | ||
// but delegates reconciling the RayJob with 'kueue.x-k8s.io/multikueue' to the Kueue. | ||
// The field is immutable. | ||
// TBD: Immutability from k8s v1.28 and above, below it won't be - is this acceptable? |
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.
@andrewsykim @kevin85421 question to you, as we can enforce immutability with CEL Validation, but only from k8s v1.25 (since it's beta).
E.g kuberay kind version is v1.25.3, so I wonder how much impact it can have
/assign @mimowo |
e008eec
to
6849598
Compare
return nil | ||
} | ||
|
||
var validManagedBy = sets.NewString( |
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.
I would suggest to use New[string]
and move the block to the top of the file
if managedBy != nil { | ||
if !validManagedBy.Has(*managedBy) { | ||
return field.NotSupported(field.NewPath("spec").Child("managedBy"), *managedBy, validManagedBy.List()) | ||
} | ||
} |
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.
if managedBy != nil { | |
if !validManagedBy.Has(*managedBy) { | |
return field.NotSupported(field.NewPath("spec").Child("managedBy"), *managedBy, validManagedBy.List()) | |
} | |
} | |
if managedBy != nil && !validManagedBy.Has(*managedBy) { | |
return field.NotSupported(field.NewPath("spec").Child("managedBy"), *managedBy, validManagedBy.List()) | |
} |
if err := validateManagedBy(rayJob.Spec.ManagedBy); err != nil { | ||
return err | ||
} |
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.
Actually, I think this validation could now be moved to CEL. cc @andrewsykim @kevin85421
Why are these changes needed?
As stated in #2544.
It allows for integration with MultiKueue (multi-cluster Kueue), in specific it provides:
Related issue number
Relates to #2544
Checks