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
Expand Up @@ -185,7 +185,31 @@ tests:
machineNetworks:
- 192.0.2.1
expectedError: "spec.platformSpec.baremetal.machineNetworks[0]: Invalid value: \"string\": value must be a valid CIDR network address"
- name: Should prune spec.controlPlaneTopology when MutableTopology feature gate is not enabled
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
controlPlaneTopology: HighlyAvailable
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
onUpdate:
- name: Should prune spec.controlPlaneTopology on update when MutableTopology feature gate is not enabled
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
controlPlaneTopology: SingleReplica
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
- name: Should be able to change External platformName from unknown to something else
initial: |
apiVersion: config.openshift.io/v1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "Infrastructure"
crdName: infrastructures.config.openshift.io
featureGates:
- MutableTopology
tests:
onCreate:
- name: Should be able to create a minimal Infrastructure without controlPlaneTopology in spec
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
- name: Should be able to create Infrastructure with spec controlPlaneTopology set to HighlyAvailable
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
controlPlaneTopology: HighlyAvailable
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
controlPlaneTopology: HighlyAvailable
- name: Should be able to create Infrastructure with spec controlPlaneTopology set to SingleReplica
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
controlPlaneTopology: SingleReplica
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
controlPlaneTopology: SingleReplica
- name: Should not allow creating Infrastructure with spec controlPlaneTopology set to an invalid value
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
controlPlaneTopology: InvalidValue
expectedError: 'spec.controlPlaneTopology: Unsupported value: "InvalidValue": supported values: "HighlyAvailable", "SingleReplica"'
- name: Should not allow creating Infrastructure with spec controlPlaneTopology set to External
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
controlPlaneTopology: External
expectedError: 'spec.controlPlaneTopology: Unsupported value: "External": supported values: "HighlyAvailable", "SingleReplica"'
- name: Should not allow creating Infrastructure with spec controlPlaneTopology set to DualReplica
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
controlPlaneTopology: DualReplica
expectedError: 'spec.controlPlaneTopology: Unsupported value: "DualReplica": supported values: "HighlyAvailable", "SingleReplica"'
- name: Should not allow creating Infrastructure with spec controlPlaneTopology set to HighlyAvailableArbiter
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
controlPlaneTopology: HighlyAvailableArbiter
expectedError: 'spec.controlPlaneTopology: Unsupported value: "HighlyAvailableArbiter": supported values: "HighlyAvailable", "SingleReplica"'
onUpdate:
- name: Should allow updating spec controlPlaneTopology from HighlyAvailable to SingleReplica
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
controlPlaneTopology: HighlyAvailable
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
controlPlaneTopology: SingleReplica
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
controlPlaneTopology: SingleReplica
- name: Should allow updating spec controlPlaneTopology from SingleReplica to HighlyAvailable
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
controlPlaneTopology: SingleReplica
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
controlPlaneTopology: HighlyAvailable
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
controlPlaneTopology: HighlyAvailable
- name: Should allow removing spec controlPlaneTopology
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
controlPlaneTopology: HighlyAvailable
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
- name: Should not allow updating spec controlPlaneTopology to an invalid value
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
controlPlaneTopology: HighlyAvailable
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
controlPlaneTopology: InvalidValue
expectedError: 'spec.controlPlaneTopology: Unsupported value: "InvalidValue": supported values: "HighlyAvailable", "SingleReplica"'
10 changes: 10 additions & 0 deletions config/v1/types_infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ type InfrastructureSpec struct {
// platformSpec holds desired information specific to the underlying
// infrastructure provider.
PlatformSpec PlatformSpec `json:"platformSpec,omitempty"`

// controlPlaneTopology expresses the desired topology configuration for control nodes.
// The 'HighlyAvailable' mode represents a "normal", 3 control node cluster.
// The 'SingleReplica' mode represents configuration where there is a single control node.
// If left blank, no change is required and no transitions will be triggered.
// +openshift:enable:FeatureGate=MutableTopology
// +openshift:validation:FeatureGateAwareEnum:featureGate="",enum=
Comment thread
jeff-roche marked this conversation as resolved.
// +openshift:validation:FeatureGateAwareEnum:featureGate=MutableTopology,enum=HighlyAvailable;SingleReplica
// +optional
ControlPlaneTopology TopologyMode `json:"controlPlaneTopology,omitempty"`
}

// InfrastructureStatus describes the infrastructure the cluster is leveraging.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ metadata:
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: CustomNoUpgrade
name: infrastructures.config.openshift.io
Expand Down Expand Up @@ -68,6 +67,16 @@ spec:
name:
type: string
type: object
controlPlaneTopology:
description: |-
controlPlaneTopology expresses the desired topology configuration for control nodes.
The 'HighlyAvailable' mode represents a "normal", 3 control node cluster.
The 'SingleReplica' mode represents configuration where there is a single control node.
If left blank, no change is required and no transitions will be triggered.
enum:
- HighlyAvailable
- SingleReplica
type: string
platformSpec:
description: |-
platformSpec holds desired information specific to the underlying
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ metadata:
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: DevPreviewNoUpgrade
name: infrastructures.config.openshift.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ 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: CustomNoUpgrade
Expand Down Expand Up @@ -68,6 +67,16 @@ spec:
name:
type: string
type: object
controlPlaneTopology:
description: |-
controlPlaneTopology expresses the desired topology configuration for control nodes.
The 'HighlyAvailable' mode represents a "normal", 3 control node cluster.
The 'SingleReplica' mode represents configuration where there is a single control node.
If left blank, no change is required and no transitions will be triggered.
enum:
- HighlyAvailable
- SingleReplica
type: string
platformSpec:
description: |-
platformSpec holds desired information specific to the underlying
Expand Down
Loading