Add label match example

Signed-off-by: JesseStutler <chenzicong4@huawei.com>
This commit is contained in:
JesseStutler 2025-03-29 14:30:19 +08:00
parent 47cf487e72
commit c47873898c
1 changed files with 9 additions and 0 deletions

View File

@ -95,6 +95,15 @@ type MemberSpec struct {
// regexMatch:
// pattern: "^node-[0-9]+$"
//
// Example for Label match:
//
// members:
// - type: Node
// selector:
// labelMatch:
// matchLabels:
// topology-rack: rack1
//
// +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="(has(self.exactMatch) ? 1 : 0) + (has(self.regexMatch) ? 1 : 0) + (has(self.labelMatch) ? 1 : 0) <= 1",message="Only one of ExactMatch, RegexMatch, or LabelMatch can be specified"
type MemberSelector struct {