Skip to content

Commit b9b7a12

Browse files
committed
Fix LabelSelector validation markers for map field
Changed MinItems/MaxItems to MinProperties/MaxProperties for the MatchLabels field in LabelSelector, as it is a map type, not an array. This resolves controller-gen CRD generation errors. Fixes #1678
1 parent 75b2144 commit b9b7a12

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api/v1/shared_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ type LabelSelector struct {
137137
// The matching logic is an AND operation on all entries.
138138
//
139139
// +required
140-
// +kubebuilder:validation:MinItems=1
141-
// +kubebuilder:validation:MaxItems=64
140+
// +kubebuilder:validation:MinProperties=1
141+
// +kubebuilder:validation:MaxProperties=64
142142
MatchLabels map[LabelKey]LabelValue `json:"matchLabels,omitempty"`
143143
}

0 commit comments

Comments
 (0)