Skip to content

Commit 29debc7

Browse files
pedjakclaude
andauthored
Fix DNS1123 validation message to match rule semantics (#2652)
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 <noreply@anthropic.com>
1 parent 8ad71d4 commit 29debc7

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

api/v1/clusterobjectset_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ type ClusterObjectSetPhase struct {
366366
// +required
367367
// +kubebuilder:validation:MinLength=1
368368
// +kubebuilder:validation:MaxLength=63
369-
// +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."
369+
// +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."
370370
Name string `json:"name"`
371371

372372
// objects is a required list of all Kubernetes objects that belong to this phase.
@@ -532,7 +532,7 @@ type ObservedPhase struct {
532532
// +required
533533
// +kubebuilder:validation:MinLength=1
534534
// +kubebuilder:validation:MaxLength=63
535-
// +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."
535+
// +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."
536536
Name string `json:"name"`
537537

538538
// digest is the digest of the phase's resolved object content

helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterobjectsets.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ spec:
150150
type: string
151151
x-kubernetes-validations:
152152
- message: the value must consist of only lowercase alphanumeric
153-
characters and hyphens, and must start with an alphabetic
154-
character and end with an alphanumeric character.
153+
characters and hyphens, and must start and end with an alphanumeric
154+
character.
155155
rule: '!format.dns1123Label().validate(self).hasValue()'
156156
objects:
157157
description: |-
@@ -649,8 +649,8 @@ spec:
649649
type: string
650650
x-kubernetes-validations:
651651
- message: the value must consist of only lowercase alphanumeric
652-
characters and hyphens, and must start with an alphabetic
653-
character and end with an alphanumeric character.
652+
characters and hyphens, and must start and end with an alphanumeric
653+
character.
654654
rule: '!format.dns1123Label().validate(self).hasValue()'
655655
required:
656656
- digest

manifests/experimental-e2e.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,8 +1474,8 @@ spec:
14741474
type: string
14751475
x-kubernetes-validations:
14761476
- message: the value must consist of only lowercase alphanumeric
1477-
characters and hyphens, and must start with an alphabetic
1478-
character and end with an alphanumeric character.
1477+
characters and hyphens, and must start and end with an alphanumeric
1478+
character.
14791479
rule: '!format.dns1123Label().validate(self).hasValue()'
14801480
objects:
14811481
description: |-
@@ -1973,8 +1973,8 @@ spec:
19731973
type: string
19741974
x-kubernetes-validations:
19751975
- message: the value must consist of only lowercase alphanumeric
1976-
characters and hyphens, and must start with an alphabetic
1977-
character and end with an alphanumeric character.
1976+
characters and hyphens, and must start and end with an alphanumeric
1977+
character.
19781978
rule: '!format.dns1123Label().validate(self).hasValue()'
19791979
required:
19801980
- digest

manifests/experimental.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,8 +1435,8 @@ spec:
14351435
type: string
14361436
x-kubernetes-validations:
14371437
- message: the value must consist of only lowercase alphanumeric
1438-
characters and hyphens, and must start with an alphabetic
1439-
character and end with an alphanumeric character.
1438+
characters and hyphens, and must start and end with an alphanumeric
1439+
character.
14401440
rule: '!format.dns1123Label().validate(self).hasValue()'
14411441
objects:
14421442
description: |-
@@ -1934,8 +1934,8 @@ spec:
19341934
type: string
19351935
x-kubernetes-validations:
19361936
- message: the value must consist of only lowercase alphanumeric
1937-
characters and hyphens, and must start with an alphabetic
1938-
character and end with an alphanumeric character.
1937+
characters and hyphens, and must start and end with an alphanumeric
1938+
character.
19391939
rule: '!format.dns1123Label().validate(self).hasValue()'
19401940
required:
19411941
- digest

0 commit comments

Comments
 (0)