Skip to content
Closed
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,142 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "Infrastructure"
crdName: infrastructures.config.openshift.io
featureGates:
- DualReplica
- HighlyAvailableArbiter
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: status should allow controlPlaneTopology value for `HighlyAvailableArbiter`
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
aws: {}
type: AWS
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: AWS
aws: {}
status:
controlPlaneTopology: HighlyAvailableArbiter
infrastructureTopology: HighlyAvailable
platform: AWS
platformStatus:
aws: {}
type: AWS
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: AWS
aws: {}
status:
controlPlaneTopology: HighlyAvailableArbiter
cpuPartitioning: None
infrastructureTopology: HighlyAvailable
platform: AWS
platformStatus:
aws:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
type: AWS
- name: should not allow changing infrastructureTopology value to `HighlyAvailableArbiter`
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
aws: {}
type: AWS
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: AWS
aws: {}
status:
controlPlaneTopology: HighlyAvailable
infrastructureTopology: HighlyAvailableArbiter
platform: AWS
platformStatus:
aws: {}
type: AWS
expectedStatusError: 'status.infrastructureTopology: Unsupported value: "HighlyAvailableArbiter": supported values: "HighlyAvailable", "SingleReplica"'
- name: status should allow controlPlaneTopology value for `DualReplica`
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
aws: {}
type: AWS
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: AWS
aws: {}
status:
controlPlaneTopology: DualReplica
infrastructureTopology: HighlyAvailable
platform: AWS
platformStatus:
aws: {}
type: AWS
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: AWS
aws: {}
status:
controlPlaneTopology: DualReplica
cpuPartitioning: None
infrastructureTopology: HighlyAvailable
platform: AWS
platformStatus:
aws:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
type: AWS
- name: should not allow changing infrastructureTopology value to `DualReplica`
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
aws: {}
type: AWS
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: AWS
aws: {}
status:
controlPlaneTopology: HighlyAvailable
infrastructureTopology: DualReplica
platform: AWS
platformStatus:
aws: {}
type: AWS
expectedStatusError: 'status.infrastructureTopology: Unsupported value: "DualReplica": supported values: "HighlyAvailable", "SingleReplica"'
2 changes: 2 additions & 0 deletions config/v1/types_infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ type InfrastructureStatus struct {
// its components are not visible within the cluster.
// +kubebuilder:default=HighlyAvailable
// +openshift:validation:FeatureGateAwareEnum:featureGate="",enum=HighlyAvailable;SingleReplica;External
// +openshift:validation:FeatureGateAwareEnum:featureGate=DualReplica,enum=HighlyAvailable;SingleReplica;DualReplica;External
// +openshift:validation:FeatureGateAwareEnum:featureGate=HighlyAvailableArbiter,enum=HighlyAvailable;HighlyAvailableArbiter;SingleReplica;External
// +openshift:validation:FeatureGateAwareEnum:featureGate=HighlyAvailableArbiter;DualReplica,enum=HighlyAvailable;HighlyAvailableArbiter;SingleReplica;DualReplica;External
ControlPlaneTopology TopologyMode `json:"controlPlaneTopology"`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,6 @@ spec:
- HighlyAvailable
- HighlyAvailableArbiter
- SingleReplica
- DualReplica
- External
type: string
cpuPartitioning:
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 @@ -320,6 +320,7 @@ infrastructures.config.openshift.io:
- GCPCustomAPIEndpoints
- GCPLabelsTags
- HighlyAvailableArbiter
- HighlyAvailableArbiter+DualReplica
- NutanixMultiSubnets
- VSphereHostVMGroupZonal
- VSphereMultiNetworks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,6 @@ spec:
its components are not visible within the cluster.
enum:
- HighlyAvailable
- HighlyAvailableArbiter
- SingleReplica
- DualReplica
- External
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- op: "replace"
path: "/spec/versions/0/schema/openAPIV3Schema/properties/status/properties/controlPlaneTopology/enum"
value:
- HighlyAvailable
- SingleReplica
- DualReplica
- External

Loading