Skip to content

Commit 8691c30

Browse files
Merge pull request #2499 from sadasu/aws-azure-gcp-dual-stack
CORS-4157: AWS, Azure: Add IPFamily to the PlatformStatus within Infra CR
2 parents f4cd2bb + fca93af commit 8691c30

File tree

30 files changed

+11684
-1
lines changed

30 files changed

+11684
-1
lines changed

config/v1/tests/infrastructures.config.openshift.io/AWSClusterHostedDNS.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ tests:
6060
aws:
6161
cloudLoadBalancerConfig:
6262
dnsType: PlatformDefault
63+
ipFamily: IPv4
6364
type: AWS
6465
- name: should be able to set dnsType to non-default value of `ClusterHosted`
6566
initial: |
@@ -101,6 +102,7 @@ tests:
101102
aws:
102103
cloudLoadBalancerConfig:
103104
dnsType: ClusterHosted
105+
ipFamily: IPv4
104106
type: AWS
105107
- name: Should not allow changing the immutable dnsType field
106108
initial: |

config/v1/tests/infrastructures.config.openshift.io/AWSClusterHostedDNSInstall.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ tests:
6060
aws:
6161
cloudLoadBalancerConfig:
6262
dnsType: PlatformDefault
63+
ipFamily: IPv4
6364
type: AWS
6465
- name: should be able to set dnsType to non-default value of `ClusterHosted`
6566
initial: |
@@ -101,6 +102,7 @@ tests:
101102
aws:
102103
cloudLoadBalancerConfig:
103104
dnsType: ClusterHosted
105+
ipFamily: IPv4
104106
type: AWS
105107
- name: Should not allow changing the immutable dnsType field
106108
initial: |
Lines changed: 297 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,297 @@
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+
- AWSDualStackInstall
6+
tests:
7+
onCreate:
8+
- name: Should be able to create a minimal Infrastructure
9+
initial: |
10+
apiVersion: config.openshift.io/v1
11+
kind: Infrastructure
12+
spec: {} # No spec is required for a Infrastructure
13+
expected: |
14+
apiVersion: config.openshift.io/v1
15+
kind: Infrastructure
16+
spec: {}
17+
onUpdate:
18+
- name: ipFamily should default to `IPv4` when not specified in AWS platform status
19+
initial: |
20+
apiVersion: config.openshift.io/v1
21+
kind: Infrastructure
22+
spec:
23+
platformSpec:
24+
aws: {}
25+
type: AWS
26+
status:
27+
controlPlaneTopology: HighlyAvailable
28+
infrastructureTopology: HighlyAvailable
29+
platform: AWS
30+
platformStatus:
31+
aws:
32+
region: us-east-1
33+
type: AWS
34+
updated: |
35+
apiVersion: config.openshift.io/v1
36+
kind: Infrastructure
37+
spec:
38+
platformSpec:
39+
type: AWS
40+
aws: {}
41+
status:
42+
controlPlaneTopology: HighlyAvailable
43+
infrastructureTopology: HighlyAvailable
44+
platform: AWS
45+
platformStatus:
46+
aws:
47+
region: us-east-1
48+
type: AWS
49+
expected: |
50+
apiVersion: config.openshift.io/v1
51+
kind: Infrastructure
52+
spec:
53+
platformSpec:
54+
type: AWS
55+
aws: {}
56+
status:
57+
controlPlaneTopology: HighlyAvailable
58+
cpuPartitioning: None
59+
infrastructureTopology: HighlyAvailable
60+
platform: AWS
61+
platformStatus:
62+
aws:
63+
cloudLoadBalancerConfig:
64+
dnsType: PlatformDefault
65+
ipFamily: IPv4
66+
region: us-east-1
67+
type: AWS
68+
- name: Should be able to set ipFamily to `DualStackIPv6Primary` in AWS platform status
69+
initial: |
70+
apiVersion: config.openshift.io/v1
71+
kind: Infrastructure
72+
spec:
73+
platformSpec:
74+
aws: {}
75+
type: AWS
76+
updated: |
77+
apiVersion: config.openshift.io/v1
78+
kind: Infrastructure
79+
spec:
80+
platformSpec:
81+
type: AWS
82+
aws: {}
83+
status:
84+
controlPlaneTopology: HighlyAvailable
85+
infrastructureTopology: HighlyAvailable
86+
platform: AWS
87+
platformStatus:
88+
aws:
89+
region: us-east-1
90+
ipFamily: DualStackIPv6Primary
91+
type: AWS
92+
expected: |
93+
apiVersion: config.openshift.io/v1
94+
kind: Infrastructure
95+
spec:
96+
platformSpec:
97+
type: AWS
98+
aws: {}
99+
status:
100+
controlPlaneTopology: HighlyAvailable
101+
cpuPartitioning: None
102+
infrastructureTopology: HighlyAvailable
103+
platform: AWS
104+
platformStatus:
105+
aws:
106+
cloudLoadBalancerConfig:
107+
dnsType: PlatformDefault
108+
ipFamily: DualStackIPv6Primary
109+
region: us-east-1
110+
type: AWS
111+
- name: Should be able to set ipFamily to `DualStackIPv4Primary` in AWS platform status
112+
initial: |
113+
apiVersion: config.openshift.io/v1
114+
kind: Infrastructure
115+
spec:
116+
platformSpec:
117+
aws: {}
118+
type: AWS
119+
updated: |
120+
apiVersion: config.openshift.io/v1
121+
kind: Infrastructure
122+
spec:
123+
platformSpec:
124+
type: AWS
125+
aws: {}
126+
status:
127+
controlPlaneTopology: HighlyAvailable
128+
infrastructureTopology: HighlyAvailable
129+
platform: AWS
130+
platformStatus:
131+
aws:
132+
region: us-east-1
133+
ipFamily: DualStackIPv4Primary
134+
type: AWS
135+
expected: |
136+
apiVersion: config.openshift.io/v1
137+
kind: Infrastructure
138+
spec:
139+
platformSpec:
140+
type: AWS
141+
aws: {}
142+
status:
143+
controlPlaneTopology: HighlyAvailable
144+
cpuPartitioning: None
145+
infrastructureTopology: HighlyAvailable
146+
platform: AWS
147+
platformStatus:
148+
aws:
149+
cloudLoadBalancerConfig:
150+
dnsType: PlatformDefault
151+
ipFamily: DualStackIPv4Primary
152+
region: us-east-1
153+
type: AWS
154+
- name: Should not be able to set ipFamily to invalid value in AWS platform status
155+
initial: |
156+
apiVersion: config.openshift.io/v1
157+
kind: Infrastructure
158+
spec:
159+
platformSpec:
160+
aws: {}
161+
type: AWS
162+
updated: |
163+
apiVersion: config.openshift.io/v1
164+
kind: Infrastructure
165+
spec:
166+
platformSpec:
167+
type: AWS
168+
aws: {}
169+
status:
170+
controlPlaneTopology: HighlyAvailable
171+
infrastructureTopology: HighlyAvailable
172+
platform: AWS
173+
platformStatus:
174+
aws:
175+
region: us-east-1
176+
ipFamily: InvalidValue
177+
type: AWS
178+
expectedStatusError: "platformStatus.aws.ipFamily: Unsupported value: \"InvalidValue\": supported values: \"IPv4\", \"DualStackIPv6Primary\", \"DualStackIPv4Primary\""
179+
- name: Should not allow changing the immutable ipFamily field in AWS platform status
180+
initial: |
181+
apiVersion: config.openshift.io/v1
182+
kind: Infrastructure
183+
spec:
184+
platformSpec:
185+
aws: {}
186+
type: AWS
187+
status:
188+
controlPlaneTopology: HighlyAvailable
189+
infrastructureTopology: HighlyAvailable
190+
platform: AWS
191+
platformStatus:
192+
aws:
193+
region: us-east-1
194+
ipFamily: IPv4
195+
type: AWS
196+
updated: |
197+
apiVersion: config.openshift.io/v1
198+
kind: Infrastructure
199+
spec:
200+
platformSpec:
201+
type: AWS
202+
aws: {}
203+
status:
204+
controlPlaneTopology: HighlyAvailable
205+
infrastructureTopology: HighlyAvailable
206+
platform: AWS
207+
platformStatus:
208+
aws:
209+
region: us-east-1
210+
ipFamily: DualStackIPv6Primary
211+
type: AWS
212+
expectedStatusError: "status.platformStatus.aws.ipFamily: Invalid value: \"string\": ipFamily is immutable once set"
213+
- name: Should allow setting the same ipFamily value in AWS platform status
214+
initial: |
215+
apiVersion: config.openshift.io/v1
216+
kind: Infrastructure
217+
spec:
218+
platformSpec:
219+
aws: {}
220+
type: AWS
221+
status:
222+
controlPlaneTopology: HighlyAvailable
223+
infrastructureTopology: HighlyAvailable
224+
platform: AWS
225+
platformStatus:
226+
aws:
227+
region: us-east-1
228+
ipFamily: DualStackIPv6Primary
229+
type: AWS
230+
updated: |
231+
apiVersion: config.openshift.io/v1
232+
kind: Infrastructure
233+
spec:
234+
platformSpec:
235+
type: AWS
236+
aws: {}
237+
status:
238+
controlPlaneTopology: HighlyAvailable
239+
infrastructureTopology: HighlyAvailable
240+
platform: AWS
241+
platformStatus:
242+
aws:
243+
region: us-east-1
244+
ipFamily: DualStackIPv6Primary
245+
type: AWS
246+
expected: |
247+
apiVersion: config.openshift.io/v1
248+
kind: Infrastructure
249+
spec:
250+
platformSpec:
251+
type: AWS
252+
aws: {}
253+
status:
254+
controlPlaneTopology: HighlyAvailable
255+
cpuPartitioning: None
256+
infrastructureTopology: HighlyAvailable
257+
platform: AWS
258+
platformStatus:
259+
aws:
260+
cloudLoadBalancerConfig:
261+
dnsType: PlatformDefault
262+
ipFamily: DualStackIPv6Primary
263+
region: us-east-1
264+
type: AWS
265+
- name: Should not be able to unset ipFamily once it has been set in AWS platform status
266+
initial: |
267+
apiVersion: config.openshift.io/v1
268+
kind: Infrastructure
269+
spec:
270+
platformSpec:
271+
aws: {}
272+
type: AWS
273+
status:
274+
controlPlaneTopology: HighlyAvailable
275+
infrastructureTopology: HighlyAvailable
276+
platform: AWS
277+
platformStatus:
278+
aws:
279+
region: us-east-1
280+
ipFamily: DualStackIPv4Primary
281+
type: AWS
282+
updated: |
283+
apiVersion: config.openshift.io/v1
284+
kind: Infrastructure
285+
spec:
286+
platformSpec:
287+
type: AWS
288+
aws: {}
289+
status:
290+
controlPlaneTopology: HighlyAvailable
291+
infrastructureTopology: HighlyAvailable
292+
platform: AWS
293+
platformStatus:
294+
aws:
295+
region: us-east-1
296+
type: AWS
297+
expectedStatusError: "status.platformStatus.aws.ipFamily: Invalid value: \"string\": ipFamily is immutable once set"

config/v1/tests/infrastructures.config.openshift.io/AzureClusterHostedDNSInstall.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ tests:
6060
azure:
6161
cloudLoadBalancerConfig:
6262
dnsType: PlatformDefault
63+
ipFamily: IPv4
6364
type: Azure
6465
- name: should be able to set dnsType to non-default value of `ClusterHosted`
6566
initial: |
@@ -101,6 +102,7 @@ tests:
101102
azure:
102103
cloudLoadBalancerConfig:
103104
dnsType: ClusterHosted
105+
ipFamily: IPv4
104106
type: Azure
105107
- name: Should not allow changing the immutable dnsType field
106108
initial: |

0 commit comments

Comments
 (0)