apis
apis copied to clipboard
Hypernode memberSelector validation rule error
Describe the bug
Currently, the kubebuilder validation in the memberSelector of hypernode is written to ensure that all three match cases cannot exist simultaneously, but the actual requirement is that only one should exist.
Expected behavior The current implementation does not check for the case where two matches exist at the same time. We should modify to like this:
// +kubebuilder:validation:XValidation:rule="has(self.exactMatch) || has(self.regexMatch) || has(self.labelMatch)",message="Either ExactMatch or RegexMatch or LabelMatch must be specified"
// +kubebuilder:validation:XValidation:rule="count([has(self.exactMatch), has(self.regexMatch), has(self.labelMatch)]) == 1",message="Only one of ExactMatch, RegexMatch, or LabelMatch can be specified"
/assign @ecosysbin
/assign
https://github.com/volcano-sh/apis/pull/167 fixed it, close