Skip to content
Open
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
@@ -0,0 +1,191 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "Infrastructure"
crdName: infrastructures.config.openshift.io
featureGates:
- GCPSovereignCloudInstall
tests:
onCreate:
- name: Should be able to create a minimal Infrastructure
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {} # No spec is required for a Infrastructure
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
onUpdate:
- name: Should be able to set a valid GCP universeDomain
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
status:
controlPlaneTopology: "HighlyAvailable"
infrastructureTopology: "HighlyAvailable"
platform: GCP
platformStatus:
type: GCP
gcp:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
status:
controlPlaneTopology: "HighlyAvailable"
cpuPartitioning: "None"
infrastructureTopology: "HighlyAvailable"
platform: GCP
platformStatus:
type: GCP
gcp:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
universeDomain: googleapis.com
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
status:
controlPlaneTopology: "HighlyAvailable"
cpuPartitioning: "None"
infrastructureTopology: "HighlyAvailable"
platform: GCP
platformStatus:
type: GCP
gcp:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
universeDomain: googleapis.com
- name: Should be able to set a sovereign cloud GCP universeDomain
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
status:
controlPlaneTopology: "HighlyAvailable"
infrastructureTopology: "HighlyAvailable"
platform: GCP
platformStatus:
type: GCP
gcp:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
status:
controlPlaneTopology: "HighlyAvailable"
infrastructureTopology: "HighlyAvailable"
platform: GCP
platformStatus:
type: GCP
gcp:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
universeDomain: s3nsapis.fr
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
status:
controlPlaneTopology: "HighlyAvailable"
cpuPartitioning: "None"
infrastructureTopology: "HighlyAvailable"
platform: GCP
platformStatus:
type: GCP
gcp:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
universeDomain: s3nsapis.fr
- name: Should not allow an invalid GCP universeDomain with uppercase characters
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
status:
controlPlaneTopology: "HighlyAvailable"
infrastructureTopology: "HighlyAvailable"
platform: GCP
platformStatus:
type: GCP
gcp:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
status:
controlPlaneTopology: "HighlyAvailable"
infrastructureTopology: "HighlyAvailable"
platform: GCP
platformStatus:
type: GCP
gcp:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
universeDomain: GoogleApis.Com
expectedStatusError: "universeDomain must be a valid DNS subdomain"
- name: Should not allow an invalid GCP universeDomain with spaces
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
status:
controlPlaneTopology: "HighlyAvailable"
infrastructureTopology: "HighlyAvailable"
platform: GCP
platformStatus:
type: GCP
gcp:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
status:
controlPlaneTopology: "HighlyAvailable"
infrastructureTopology: "HighlyAvailable"
platform: GCP
platformStatus:
type: GCP
gcp:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
universeDomain: "not a domain"
expectedStatusError: "universeDomain must be a valid DNS subdomain"
- name: Should not allow a GCP universeDomain starting with a hyphen
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
status:
controlPlaneTopology: "HighlyAvailable"
infrastructureTopology: "HighlyAvailable"
platform: GCP
platformStatus:
type: GCP
gcp:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
status:
controlPlaneTopology: "HighlyAvailable"
infrastructureTopology: "HighlyAvailable"
platform: GCP
platformStatus:
type: GCP
gcp:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
universeDomain: "-invalid.com"
expectedStatusError: "universeDomain must be a valid DNS subdomain"
18 changes: 18 additions & 0 deletions config/v1/types_infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,24 @@ type GCPPlatformStatus struct {
// +nullable
CloudLoadBalancerConfig *CloudLoadBalancerConfig `json:"cloudLoadBalancerConfig,omitempty"`

// universeDomain is the GCP universe domain for the cluster, detected from
// the installer credentials. Components with their own GCP credentials should
// read the universe domain from those credentials, as they are the authoritative
// source. This field is provided for components that do not have GCP credentials
// and for general observability.
//
// When omitted, standard public GCP (googleapis.com) is assumed.
//
// universeDomain must be a valid DNS subdomain: it must contain no more than 253 characters,
// contain only lowercase alphanumeric characters, '-' or '.', and start and end with an alphanumeric character.
//
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="universeDomain must be a valid DNS subdomain: contain no more than 253 characters, contain only lowercase alphanumeric characters, '-' or '.', and start and end with an alphanumeric character"
// +optional
// +openshift:enable:FeatureGate=GCPSovereignCloudInstall
UniverseDomain string `json:"universeDomain,omitempty"`

// This field was introduced and removed under tech preview.
// serviceEndpoints specifies endpoints that override the default endpoints
// used when creating clients to interact with GCP services.
Expand Down
2 changes: 1 addition & 1 deletion config/v1/types_infrastructure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

const (
infraCRDDefaultFilePath = "0000_10_config-operator_01_infrastructures-Default.crd.yaml"
infraCRDTestPreviewFilePath = "0000_10_config-operator_01_infrastructures-SelfManagedHA-TechPreviewNoUpgrade.crd.yaml"
infraCRDTestPreviewFilePath = "0000_10_config-operator_01_infrastructures-TechPreviewNoUpgrade.crd.yaml"
)

// TestInfrastructureStatusDefault verifies that the infrastructure CR status does not have default value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2062,6 +2062,27 @@ spec:
- message: resourceTags are immutable and may only be configured
during installation
rule: self.all(x, x in oldSelf) && oldSelf.all(x, x in self)
universeDomain:
description: |-
universeDomain is the GCP universe domain for the cluster, detected from
the installer credentials. Components with their own GCP credentials should
read the universe domain from those credentials, as they are the authoritative
source. This field is provided for components that do not have GCP credentials
and for general observability.

When omitted, standard public GCP (googleapis.com) is assumed.

universeDomain must be a valid DNS subdomain: it must contain no more than 253 characters,
contain only lowercase alphanumeric characters, '-' or '.', and start and end with an alphanumeric character.
maxLength: 253
minLength: 1
type: string
x-kubernetes-validations:
- message: 'universeDomain must be a valid DNS subdomain:
contain no more than 253 characters, contain only lowercase
alphanumeric characters, ''-'' or ''.'', and start and
end with an alphanumeric character'
rule: '!format.dns1123Subdomain().validate(self).hasValue()'
type: object
x-kubernetes-validations:
- message: resourceLabels may only be configured during installation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2047,6 +2047,27 @@ spec:
- message: resourceTags are immutable and may only be configured
during installation
rule: self.all(x, x in oldSelf) && oldSelf.all(x, x in self)
universeDomain:
description: |-
universeDomain is the GCP universe domain for the cluster, detected from
the installer credentials. Components with their own GCP credentials should
read the universe domain from those credentials, as they are the authoritative
source. This field is provided for components that do not have GCP credentials
and for general observability.
When omitted, standard public GCP (googleapis.com) is assumed.
universeDomain must be a valid DNS subdomain: it must contain no more than 253 characters,
contain only lowercase alphanumeric characters, '-' or '.', and start and end with an alphanumeric character.
maxLength: 253
minLength: 1
type: string
x-kubernetes-validations:
- message: 'universeDomain must be a valid DNS subdomain:
contain no more than 253 characters, contain only lowercase
alphanumeric characters, ''-'' or ''.'', and start and
end with an alphanumeric character'
rule: '!format.dns1123Subdomain().validate(self).hasValue()'
type: object
x-kubernetes-validations:
- message: resourceLabels may only be configured during installation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2062,6 +2062,27 @@ spec:
- message: resourceTags are immutable and may only be configured
during installation
rule: self.all(x, x in oldSelf) && oldSelf.all(x, x in self)
universeDomain:
description: |-
universeDomain is the GCP universe domain for the cluster, detected from
the installer credentials. Components with their own GCP credentials should
read the universe domain from those credentials, as they are the authoritative
source. This field is provided for components that do not have GCP credentials
and for general observability.

When omitted, standard public GCP (googleapis.com) is assumed.

universeDomain must be a valid DNS subdomain: it must contain no more than 253 characters,
contain only lowercase alphanumeric characters, '-' or '.', and start and end with an alphanumeric character.
maxLength: 253
minLength: 1
type: string
x-kubernetes-validations:
- message: 'universeDomain must be a valid DNS subdomain:
contain no more than 253 characters, contain only lowercase
alphanumeric characters, ''-'' or ''.'', and start and
end with an alphanumeric character'
rule: '!format.dns1123Subdomain().validate(self).hasValue()'
type: object
x-kubernetes-validations:
- message: resourceLabels may only be configured during installation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2062,6 +2062,27 @@ spec:
- message: resourceTags are immutable and may only be configured
during installation
rule: self.all(x, x in oldSelf) && oldSelf.all(x, x in self)
universeDomain:
description: |-
universeDomain is the GCP universe domain for the cluster, detected from
the installer credentials. Components with their own GCP credentials should
read the universe domain from those credentials, as they are the authoritative
source. This field is provided for components that do not have GCP credentials
and for general observability.

When omitted, standard public GCP (googleapis.com) is assumed.

universeDomain must be a valid DNS subdomain: it must contain no more than 253 characters,
contain only lowercase alphanumeric characters, '-' or '.', and start and end with an alphanumeric character.
maxLength: 253
minLength: 1
type: string
x-kubernetes-validations:
- message: 'universeDomain must be a valid DNS subdomain:
contain no more than 253 characters, contain only lowercase
alphanumeric characters, ''-'' or ''.'', and start and
end with an alphanumeric character'
rule: '!format.dns1123Subdomain().validate(self).hasValue()'
type: object
x-kubernetes-validations:
- message: resourceLabels may only be configured during installation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
annotations:
api-approved.openshift.io: https://github.com/openshift/api/pull/470
api.openshift.io/merged-by-featuregates: "true"
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
release.openshift.io/bootstrap-required: "true"
release.openshift.io/feature-set: TechPreviewNoUpgrade
Expand Down
1 change: 1 addition & 0 deletions config/v1/zz_generated.featuregated-crd-manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ infrastructures.config.openshift.io:
- AzureDualStackInstall
- DualReplica
- DyanmicServiceEndpointIBMCloud
- GCPSovereignCloudInstall
- MutableTopology
- NutanixMultiSubnets
- OnPremDNSRecords
Expand Down
Loading