Skip to content

Commit 6bababe

Browse files
authored
Merge pull request #2283 from JoelSpeed/dual-replica-dev-preview
OCPEDGE-1775: Enable separation of conflicting enum values, and drop DualReplica to DevPreview
2 parents 29e7c44 + 6ecd9ec commit 6bababe

20 files changed

+4932
-17
lines changed
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
2+
name: "Infrastructure"
3+
crdName: infrastructures.config.openshift.io
4+
featureGates:
5+
- DualReplica
6+
- HighlyAvailableArbiter
7+
tests:
8+
onCreate:
9+
- name: Should be able to create a minimal Infrastructure
10+
initial: |
11+
apiVersion: config.openshift.io/v1
12+
kind: Infrastructure
13+
spec: {} # No spec is required for a Infrastructure
14+
expected: |
15+
apiVersion: config.openshift.io/v1
16+
kind: Infrastructure
17+
spec: {}
18+
onUpdate:
19+
- name: status should allow controlPlaneTopology value for `HighlyAvailableArbiter`
20+
initial: |
21+
apiVersion: config.openshift.io/v1
22+
kind: Infrastructure
23+
spec:
24+
platformSpec:
25+
aws: {}
26+
type: AWS
27+
updated: |
28+
apiVersion: config.openshift.io/v1
29+
kind: Infrastructure
30+
spec:
31+
platformSpec:
32+
type: AWS
33+
aws: {}
34+
status:
35+
controlPlaneTopology: HighlyAvailableArbiter
36+
infrastructureTopology: HighlyAvailable
37+
platform: AWS
38+
platformStatus:
39+
aws: {}
40+
type: AWS
41+
expected: |
42+
apiVersion: config.openshift.io/v1
43+
kind: Infrastructure
44+
spec:
45+
platformSpec:
46+
type: AWS
47+
aws: {}
48+
status:
49+
controlPlaneTopology: HighlyAvailableArbiter
50+
cpuPartitioning: None
51+
infrastructureTopology: HighlyAvailable
52+
platform: AWS
53+
platformStatus:
54+
aws:
55+
cloudLoadBalancerConfig:
56+
dnsType: PlatformDefault
57+
type: AWS
58+
- name: should not allow changing infrastructureTopology value to `HighlyAvailableArbiter`
59+
initial: |
60+
apiVersion: config.openshift.io/v1
61+
kind: Infrastructure
62+
spec:
63+
platformSpec:
64+
aws: {}
65+
type: AWS
66+
updated: |
67+
apiVersion: config.openshift.io/v1
68+
kind: Infrastructure
69+
spec:
70+
platformSpec:
71+
type: AWS
72+
aws: {}
73+
status:
74+
controlPlaneTopology: HighlyAvailable
75+
infrastructureTopology: HighlyAvailableArbiter
76+
platform: AWS
77+
platformStatus:
78+
aws: {}
79+
type: AWS
80+
expectedStatusError: 'status.infrastructureTopology: Unsupported value: "HighlyAvailableArbiter": supported values: "HighlyAvailable", "SingleReplica"'
81+
- name: status should allow controlPlaneTopology value for `DualReplica`
82+
initial: |
83+
apiVersion: config.openshift.io/v1
84+
kind: Infrastructure
85+
spec:
86+
platformSpec:
87+
aws: {}
88+
type: AWS
89+
updated: |
90+
apiVersion: config.openshift.io/v1
91+
kind: Infrastructure
92+
spec:
93+
platformSpec:
94+
type: AWS
95+
aws: {}
96+
status:
97+
controlPlaneTopology: DualReplica
98+
infrastructureTopology: HighlyAvailable
99+
platform: AWS
100+
platformStatus:
101+
aws: {}
102+
type: AWS
103+
expected: |
104+
apiVersion: config.openshift.io/v1
105+
kind: Infrastructure
106+
spec:
107+
platformSpec:
108+
type: AWS
109+
aws: {}
110+
status:
111+
controlPlaneTopology: DualReplica
112+
cpuPartitioning: None
113+
infrastructureTopology: HighlyAvailable
114+
platform: AWS
115+
platformStatus:
116+
aws:
117+
cloudLoadBalancerConfig:
118+
dnsType: PlatformDefault
119+
type: AWS
120+
- name: should not allow changing infrastructureTopology value to `DualReplica`
121+
initial: |
122+
apiVersion: config.openshift.io/v1
123+
kind: Infrastructure
124+
spec:
125+
platformSpec:
126+
aws: {}
127+
type: AWS
128+
updated: |
129+
apiVersion: config.openshift.io/v1
130+
kind: Infrastructure
131+
spec:
132+
platformSpec:
133+
type: AWS
134+
aws: {}
135+
status:
136+
controlPlaneTopology: HighlyAvailable
137+
infrastructureTopology: DualReplica
138+
platform: AWS
139+
platformStatus:
140+
aws: {}
141+
type: AWS
142+
expectedStatusError: 'status.infrastructureTopology: Unsupported value: "DualReplica": supported values: "HighlyAvailable", "SingleReplica"'

config/v1/types_infrastructure.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ type InfrastructureStatus struct {
9999
// its components are not visible within the cluster.
100100
// +kubebuilder:default=HighlyAvailable
101101
// +openshift:validation:FeatureGateAwareEnum:featureGate="",enum=HighlyAvailable;SingleReplica;External
102-
// +openshift:validation:FeatureGateAwareEnum:featureGate=HighlyAvailableArbiter;DualReplica,enum=HighlyAvailable;HighlyAvailableArbiter;SingleReplica;DualReplica;External
102+
// +openshift:validation:FeatureGateAwareEnum:featureGate=HighlyAvailableArbiter,enum=HighlyAvailable;HighlyAvailableArbiter;SingleReplica;External
103+
// +openshift:validation:FeatureGateAwareEnum:featureGate=DualReplica,enum=HighlyAvailable;SingleReplica;DualReplica;External
104+
// +openshift:validation:FeatureGateAwareEnum:requiredFeatureGate=HighlyAvailableArbiter;DualReplica,enum=HighlyAvailable;HighlyAvailableArbiter;SingleReplica;DualReplica;External
103105
ControlPlaneTopology TopologyMode `json:"controlPlaneTopology"`
104106

105107
// infrastructureTopology expresses the expectations for infrastructure services that do not run on control

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-TechPreviewNoUpgrade.crd.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,6 @@ spec:
11301130
- HighlyAvailable
11311131
- HighlyAvailableArbiter
11321132
- SingleReplica
1133-
- DualReplica
11341133
- External
11351134
type: string
11361135
cpuPartitioning:

config/v1/zz_generated.featuregated-crd-manifests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ infrastructures.config.openshift.io:
321321
- GCPCustomAPIEndpoints
322322
- GCPLabelsTags
323323
- HighlyAvailableArbiter
324+
- HighlyAvailableArbiter+DualReplica
324325
- NutanixMultiSubnets
325326
- VSphereHostVMGroupZonal
326327
- VSphereMultiNetworks

config/v1/zz_generated.featuregated-crd-manifests/infrastructures.config.openshift.io/DualReplica.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,6 @@ spec:
10361036
its components are not visible within the cluster.
10371037
enum:
10381038
- HighlyAvailable
1039-
- HighlyAvailableArbiter
10401039
- SingleReplica
10411040
- DualReplica
10421041
- External

0 commit comments

Comments
 (0)