Skip to content

Commit 5aa9d22

Browse files
authored
Merge pull request #4851 from serngawy/longName
✨ ROSA: support long cluster name
2 parents e7c9629 + b173354 commit 5aa9d22

File tree

5 files changed

+37
-11
lines changed

5 files changed

+37
-11
lines changed

config/crd/bases/controlplane.cluster.x-k8s.io_rosacontrolplanes.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,19 @@ spec:
108108
type: string
109109
type: object
110110
x-kubernetes-map-type: atomic
111+
domainPrefix:
112+
description: DomainPrefix is an optional prefix added to the cluster's
113+
domain name. It will be used when generating a sub-domain for the
114+
cluster on openshiftapps domain. It must be valid DNS-1035 label
115+
consisting of lower case alphanumeric characters or '-', start with
116+
an alphabetic character end with an alphanumeric character and have
117+
a max length of 15 characters.
118+
maxLength: 15
119+
pattern: ^[a-z]([-a-z0-9]*[a-z0-9])?$
120+
type: string
121+
x-kubernetes-validations:
122+
- message: domainPrefix is immutable
123+
rule: self == oldSelf
111124
endpointAccess:
112125
default: Public
113126
description: EndpointAccess specifies the publishing scope of cluster
@@ -343,8 +356,8 @@ spec:
343356
description: Cluster name must be valid DNS-1035 label, so it must
344357
consist of lower case alphanumeric characters or '-', start with
345358
an alphabetic character, end with an alphanumeric character and
346-
have a max length of 15 characters.
347-
maxLength: 15
359+
have a max length of 54 characters.
360+
maxLength: 54
348361
pattern: ^[a-z]([-a-z0-9]*[a-z0-9])?$
349362
type: string
350363
x-kubernetes-validations:

controlplane/rosa/api/v1beta2/rosacontrolplane_types.go

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,26 @@ const (
4242
type RosaControlPlaneSpec struct { //nolint: maligned
4343
// Cluster name must be valid DNS-1035 label, so it must consist of lower case alphanumeric
4444
// characters or '-', start with an alphabetic character, end with an alphanumeric character
45-
// and have a max length of 15 characters.
45+
// and have a max length of 54 characters.
4646
//
47+
// +immutable
4748
// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="rosaClusterName is immutable"
48-
// +kubebuilder:validation:MaxLength:=15
49+
// +kubebuilder:validation:MaxLength:=54
4950
// +kubebuilder:validation:Pattern:=`^[a-z]([-a-z0-9]*[a-z0-9])?$`
50-
// +immutable
5151
RosaClusterName string `json:"rosaClusterName"`
5252

53+
// DomainPrefix is an optional prefix added to the cluster's domain name. It will be used
54+
// when generating a sub-domain for the cluster on openshiftapps domain. It must be valid DNS-1035 label
55+
// consisting of lower case alphanumeric characters or '-', start with an alphabetic character
56+
// end with an alphanumeric character and have a max length of 15 characters.
57+
//
58+
// +immutable
59+
// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="domainPrefix is immutable"
60+
// +kubebuilder:validation:MaxLength:=15
61+
// +kubebuilder:validation:Pattern:=`^[a-z]([-a-z0-9]*[a-z0-9])?$`
62+
// +optional
63+
DomainPrefix string `json:"domainPrefix,omitempty"`
64+
5365
// The Subnet IDs to use when installing the cluster.
5466
// SubnetIDs should come in pairs; two per availability zone, one private and one public.
5567
Subnets []string `json:"subnets"`

controlplane/rosa/controllers/rosacontrolplane_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ func (r *ROSAControlPlaneReconciler) reconcileNormal(ctx context.Context, rosaSc
276276
ocmClusterSpec := ocm.Spec{
277277
DryRun: ptr.To(false),
278278
Name: rosaScope.RosaClusterName(),
279+
DomainPrefix: rosaScope.ControlPlane.Spec.DomainPrefix,
279280
Region: rosaScope.ControlPlane.Spec.Region,
280281
MultiAZ: true,
281282
Version: ocm.CreateVersionID(rosaScope.ControlPlane.Spec.Version, ocm.DefaultChannelGroup),

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ require (
2929
github.com/onsi/ginkgo/v2 v2.13.1
3030
github.com/onsi/gomega v1.30.0
3131
github.com/openshift-online/ocm-common v0.0.0-20240129111424-ff8c6c11d909
32-
github.com/openshift-online/ocm-sdk-go v0.1.404
33-
github.com/openshift/rosa v1.2.35-rc1.0.20240229115423-42874686e22d
32+
github.com/openshift-online/ocm-sdk-go v0.1.406
33+
github.com/openshift/rosa v1.2.35-rc1.0.20240301152457-ad986cecd364
3434
github.com/pkg/errors v0.9.1
3535
github.com/prometheus/client_golang v1.18.0
3636
github.com/sergi/go-diff v1.3.1

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,10 +481,10 @@ github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b h1
481481
github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ=
482482
github.com/openshift-online/ocm-common v0.0.0-20240129111424-ff8c6c11d909 h1:WV67GNazQuGDaLX3kBbz0859NYPOQCsDCY5XUScF85M=
483483
github.com/openshift-online/ocm-common v0.0.0-20240129111424-ff8c6c11d909/go.mod h1:7FaAb07S63RF4sFMLSLtQaJLvPdaRnhAT4dBLD8/5kM=
484-
github.com/openshift-online/ocm-sdk-go v0.1.404 h1:rcmqyUYowD1yr1f7NQmoTqa1d/6zW0ZAxqYcpHpV2dk=
485-
github.com/openshift-online/ocm-sdk-go v0.1.404/go.mod h1:tke8vKcE7eHKyRbkJv6qo4ljo919zhx04uyQTcgF5cQ=
486-
github.com/openshift/rosa v1.2.35-rc1.0.20240229115423-42874686e22d h1:5LHaLb2YhmAaSkODnPLT/jbTE5oYmkrbkJ4jkYi7tpE=
487-
github.com/openshift/rosa v1.2.35-rc1.0.20240229115423-42874686e22d/go.mod h1:CR7cWdXZLWpsyskvqTWtAZBG5PaWrzYHy9tbaubbXIA=
484+
github.com/openshift-online/ocm-sdk-go v0.1.406 h1:DB97+wipdP1IK6D2CTINqCjs9obJSLzgwpfsx+94lBQ=
485+
github.com/openshift-online/ocm-sdk-go v0.1.406/go.mod h1:8ECJertR5BiblaX5f2siXHXpi+ydYZjoROlVMppmmV4=
486+
github.com/openshift/rosa v1.2.35-rc1.0.20240301152457-ad986cecd364 h1:j1aGLgZhO5xXpYgGAjmraioHTvCK7+gXZXoN9cnpnkw=
487+
github.com/openshift/rosa v1.2.35-rc1.0.20240301152457-ad986cecd364/go.mod h1:kSNsBW8P9KfLCsZYGIrr/aKbLDct8I5gW0e4cCRrr0o=
488488
github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
489489
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
490490
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=

0 commit comments

Comments
 (0)