From 76ee584f9e7a5446fb300ad990303e28f2bb5b12 Mon Sep 17 00:00:00 2001 From: Predrag Knezevic Date: Wed, 15 Apr 2026 16:15:35 +0200 Subject: [PATCH] Fix DNS1123 validation message to match rule semantics The XValidation message for dns1123Label() incorrectly stated that values "must start with an alphabetic character". DNS1123 labels allow starting with a digit, so the message now reads "must start and end with an alphanumeric character" to match the actual rule. Co-Authored-By: Claude Opus 4.6 --- api/v1/clusterobjectset_types.go | 4 ++-- .../olm.operatorframework.io_clusterobjectsets.yaml | 8 ++++---- manifests/experimental-e2e.yaml | 8 ++++---- manifests/experimental.yaml | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/api/v1/clusterobjectset_types.go b/api/v1/clusterobjectset_types.go index d7e755992..b9aeb96f2 100644 --- a/api/v1/clusterobjectset_types.go +++ b/api/v1/clusterobjectset_types.go @@ -366,7 +366,7 @@ type ClusterObjectSetPhase struct { // +required // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=63 - // +kubebuilder:validation:XValidation:rule=`!format.dns1123Label().validate(self).hasValue()`,message="the value must consist of only lowercase alphanumeric characters and hyphens, and must start with an alphabetic character and end with an alphanumeric character." + // +kubebuilder:validation:XValidation:rule=`!format.dns1123Label().validate(self).hasValue()`,message="the value must consist of only lowercase alphanumeric characters and hyphens, and must start and end with an alphanumeric character." Name string `json:"name"` // objects is a required list of all Kubernetes objects that belong to this phase. @@ -532,7 +532,7 @@ type ObservedPhase struct { // +required // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=63 - // +kubebuilder:validation:XValidation:rule=`!format.dns1123Label().validate(self).hasValue()`,message="the value must consist of only lowercase alphanumeric characters and hyphens, and must start with an alphabetic character and end with an alphanumeric character." + // +kubebuilder:validation:XValidation:rule=`!format.dns1123Label().validate(self).hasValue()`,message="the value must consist of only lowercase alphanumeric characters and hyphens, and must start and end with an alphanumeric character." Name string `json:"name"` // digest is the digest of the phase's resolved object content diff --git a/helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterobjectsets.yaml b/helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterobjectsets.yaml index 19c53bad9..0c9404918 100644 --- a/helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterobjectsets.yaml +++ b/helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterobjectsets.yaml @@ -150,8 +150,8 @@ spec: type: string x-kubernetes-validations: - message: the value must consist of only lowercase alphanumeric - characters and hyphens, and must start with an alphabetic - character and end with an alphanumeric character. + characters and hyphens, and must start and end with an alphanumeric + character. rule: '!format.dns1123Label().validate(self).hasValue()' objects: description: |- @@ -649,8 +649,8 @@ spec: type: string x-kubernetes-validations: - message: the value must consist of only lowercase alphanumeric - characters and hyphens, and must start with an alphabetic - character and end with an alphanumeric character. + characters and hyphens, and must start and end with an alphanumeric + character. rule: '!format.dns1123Label().validate(self).hasValue()' required: - digest diff --git a/manifests/experimental-e2e.yaml b/manifests/experimental-e2e.yaml index f52b31a39..4e19ea3f4 100644 --- a/manifests/experimental-e2e.yaml +++ b/manifests/experimental-e2e.yaml @@ -1474,8 +1474,8 @@ spec: type: string x-kubernetes-validations: - message: the value must consist of only lowercase alphanumeric - characters and hyphens, and must start with an alphabetic - character and end with an alphanumeric character. + characters and hyphens, and must start and end with an alphanumeric + character. rule: '!format.dns1123Label().validate(self).hasValue()' objects: description: |- @@ -1973,8 +1973,8 @@ spec: type: string x-kubernetes-validations: - message: the value must consist of only lowercase alphanumeric - characters and hyphens, and must start with an alphabetic - character and end with an alphanumeric character. + characters and hyphens, and must start and end with an alphanumeric + character. rule: '!format.dns1123Label().validate(self).hasValue()' required: - digest diff --git a/manifests/experimental.yaml b/manifests/experimental.yaml index b8e48ba2f..c49ab79a0 100644 --- a/manifests/experimental.yaml +++ b/manifests/experimental.yaml @@ -1435,8 +1435,8 @@ spec: type: string x-kubernetes-validations: - message: the value must consist of only lowercase alphanumeric - characters and hyphens, and must start with an alphabetic - character and end with an alphanumeric character. + characters and hyphens, and must start and end with an alphanumeric + character. rule: '!format.dns1123Label().validate(self).hasValue()' objects: description: |- @@ -1934,8 +1934,8 @@ spec: type: string x-kubernetes-validations: - message: the value must consist of only lowercase alphanumeric - characters and hyphens, and must start with an alphabetic - character and end with an alphanumeric character. + characters and hyphens, and must start and end with an alphanumeric + character. rule: '!format.dns1123Label().validate(self).hasValue()' required: - digest