From 40cecfdc88528163d48e9e7e25f185364c26a47e Mon Sep 17 00:00:00 2001 From: Killian Golds Date: Fri, 3 Oct 2025 15:01:13 +0100 Subject: [PATCH] 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. Signed-off-by: Killian Golds --- api/v1/shared_types.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/v1/shared_types.go b/api/v1/shared_types.go index bc315fd4f..5d5d3e763 100644 --- a/api/v1/shared_types.go +++ b/api/v1/shared_types.go @@ -137,7 +137,7 @@ type LabelSelector struct { // The matching logic is an AND operation on all entries. // // +required - // +kubebuilder:validation:MinItems=1 - // +kubebuilder:validation:MaxItems=64 + // +kubebuilder:validation:MinProperties=1 + // +kubebuilder:validation:MaxProperties=64 MatchLabels map[LabelKey]LabelValue `json:"matchLabels,omitempty"` }