Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ ROSA: support long cluster name #4851

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,19 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
domainPrefix:
description: DomainPrefix is an optional prefix added to the cluster's
domain name. It will be used when generating a sub-domain for the
cluster on openshiftapps domain. It must be valid DNS-1035 label
consisting of lower case alphanumeric characters or '-', start with
an alphabetic character end with an alphanumeric character and have
a max length of 15 characters.
maxLength: 15
pattern: ^[a-z]([-a-z0-9]*[a-z0-9])?$
type: string
x-kubernetes-validations:
- message: domainPrefix is immutable
rule: self == oldSelf
endpointAccess:
default: Public
description: EndpointAccess specifies the publishing scope of cluster
Expand Down Expand Up @@ -343,8 +356,8 @@ spec:
description: Cluster name must be valid DNS-1035 label, so it must
consist of lower case alphanumeric characters or '-', start with
an alphabetic character, end with an alphanumeric character and
have a max length of 15 characters.
maxLength: 15
have a max length of 54 characters.
maxLength: 54
pattern: ^[a-z]([-a-z0-9]*[a-z0-9])?$
type: string
x-kubernetes-validations:
Expand Down
18 changes: 15 additions & 3 deletions controlplane/rosa/api/v1beta2/rosacontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,26 @@ const (
type RosaControlPlaneSpec struct { //nolint: maligned
// Cluster name must be valid DNS-1035 label, so it must consist of lower case alphanumeric
// characters or '-', start with an alphabetic character, end with an alphanumeric character
// and have a max length of 15 characters.
// and have a max length of 54 characters.
//
// +immutable
// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="rosaClusterName is immutable"
// +kubebuilder:validation:MaxLength:=15
// +kubebuilder:validation:MaxLength:=54
// +kubebuilder:validation:Pattern:=`^[a-z]([-a-z0-9]*[a-z0-9])?$`
// +immutable
RosaClusterName string `json:"rosaClusterName"`

// DomainPrefix is an optional prefix added to the cluster's domain name. It will be used
// when generating a sub-domain for the cluster on openshiftapps domain. It must be valid DNS-1035 label
// consisting of lower case alphanumeric characters or '-', start with an alphabetic character
// end with an alphanumeric character and have a max length of 15 characters.
//
// +immutable
// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="domainPrefix is immutable"
// +kubebuilder:validation:MaxLength:=15
// +kubebuilder:validation:Pattern:=`^[a-z]([-a-z0-9]*[a-z0-9])?$`
// +optional
DomainPrefix string `json:"domainPrefix,omitempty"`

// The Subnet IDs to use when installing the cluster.
// SubnetIDs should come in pairs; two per availability zone, one private and one public.
Subnets []string `json:"subnets"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ func (r *ROSAControlPlaneReconciler) reconcileNormal(ctx context.Context, rosaSc
ocmClusterSpec := ocm.Spec{
DryRun: ptr.To(false),
Name: rosaScope.RosaClusterName(),
DomainPrefix: rosaScope.ControlPlane.Spec.DomainPrefix,
Region: rosaScope.ControlPlane.Spec.Region,
MultiAZ: true,
Version: ocm.CreateVersionID(rosaScope.ControlPlane.Spec.Version, ocm.DefaultChannelGroup),
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ require (
github.com/onsi/ginkgo/v2 v2.13.1
github.com/onsi/gomega v1.30.0
github.com/openshift-online/ocm-common v0.0.0-20240129111424-ff8c6c11d909
github.com/openshift-online/ocm-sdk-go v0.1.404
github.com/openshift/rosa v1.2.35-rc1.0.20240229115423-42874686e22d
github.com/openshift-online/ocm-sdk-go v0.1.406
github.com/openshift/rosa v1.2.35-rc1.0.20240301152457-ad986cecd364
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.18.0
github.com/sergi/go-diff v1.3.1
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,10 @@ github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b h1
github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ=
github.com/openshift-online/ocm-common v0.0.0-20240129111424-ff8c6c11d909 h1:WV67GNazQuGDaLX3kBbz0859NYPOQCsDCY5XUScF85M=
github.com/openshift-online/ocm-common v0.0.0-20240129111424-ff8c6c11d909/go.mod h1:7FaAb07S63RF4sFMLSLtQaJLvPdaRnhAT4dBLD8/5kM=
github.com/openshift-online/ocm-sdk-go v0.1.404 h1:rcmqyUYowD1yr1f7NQmoTqa1d/6zW0ZAxqYcpHpV2dk=
github.com/openshift-online/ocm-sdk-go v0.1.404/go.mod h1:tke8vKcE7eHKyRbkJv6qo4ljo919zhx04uyQTcgF5cQ=
github.com/openshift/rosa v1.2.35-rc1.0.20240229115423-42874686e22d h1:5LHaLb2YhmAaSkODnPLT/jbTE5oYmkrbkJ4jkYi7tpE=
github.com/openshift/rosa v1.2.35-rc1.0.20240229115423-42874686e22d/go.mod h1:CR7cWdXZLWpsyskvqTWtAZBG5PaWrzYHy9tbaubbXIA=
github.com/openshift-online/ocm-sdk-go v0.1.406 h1:DB97+wipdP1IK6D2CTINqCjs9obJSLzgwpfsx+94lBQ=
github.com/openshift-online/ocm-sdk-go v0.1.406/go.mod h1:8ECJertR5BiblaX5f2siXHXpi+ydYZjoROlVMppmmV4=
github.com/openshift/rosa v1.2.35-rc1.0.20240301152457-ad986cecd364 h1:j1aGLgZhO5xXpYgGAjmraioHTvCK7+gXZXoN9cnpnkw=
github.com/openshift/rosa v1.2.35-rc1.0.20240301152457-ad986cecd364/go.mod h1:kSNsBW8P9KfLCsZYGIrr/aKbLDct8I5gW0e4cCRrr0o=
github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
Expand Down
Loading