Skip to content

Commit 5255664

Browse files
authored
Merge pull request #12252 from sbueringer/pr-fix-namespace-pattern
[release-1.10] 🐛 Fix pattern on Cluster classNamespace field
2 parents 29865ba + 30e7a32 commit 5255664

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

api/v1beta1/cluster_types.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -546,13 +546,15 @@ type Topology struct {
546546
// +kubebuilder:validation:MaxLength=253
547547
Class string `json:"class"`
548548

549-
// classNamespace is the namespace of the ClusterClass object to create the topology.
550-
// If the namespace is empty or not set, it is defaulted to the namespace of the cluster object.
551-
// Value must follow the DNS1123Subdomain syntax.
549+
// classNamespace is the namespace of the ClusterClass that should be used for the topology.
550+
// If classNamespace is empty or not set, it is defaulted to the namespace of the Cluster object.
551+
// classNamespace must be a valid namespace name and because of that be at most 63 characters in length
552+
// and it must consist only of lower case alphanumeric characters or hyphens (-), and must start
553+
// and end with an alphanumeric character.
552554
// +optional
553555
// +kubebuilder:validation:MinLength=1
554-
// +kubebuilder:validation:MaxLength=253
555-
// +kubebuilder:validation:Pattern=`^[a-z0-9](?:[-a-z0-9]*[a-z0-9])?(?:\.[a-z0-9](?:[-a-z0-9]*[a-z0-9])?)*$`
556+
// +kubebuilder:validation:MaxLength=63
557+
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
556558
ClassNamespace string `json:"classNamespace,omitempty"`
557559

558560
// version is the Kubernetes version of the cluster.

api/v1beta1/zz_generated.openapi.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/cluster.x-k8s.io_clusters.yaml

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)