Skip to content

Commit e642193

Browse files
committed
AWS, Azure: Add IPFamily to the PlatformStatus within Infra CR
The new IPFamily can be set to IPv4, DualIPv6Primary and DualIPv4Primary. This capability is currently behind feature gates that were added earlier. Added tests for this new field.
1 parent 8a46f74 commit e642193

File tree

18 files changed

+11448
-1
lines changed

18 files changed

+11448
-1
lines changed
Lines changed: 289 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,289 @@
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+
region: us-east-1
64+
ipFamily: IPv4
65+
type: AWS
66+
- name: Should be able to set ipFamily to `DualIPv6Primary` in AWS platform status
67+
initial: |
68+
apiVersion: config.openshift.io/v1
69+
kind: Infrastructure
70+
spec:
71+
platformSpec:
72+
aws: {}
73+
type: AWS
74+
updated: |
75+
apiVersion: config.openshift.io/v1
76+
kind: Infrastructure
77+
spec:
78+
platformSpec:
79+
type: AWS
80+
aws: {}
81+
status:
82+
controlPlaneTopology: HighlyAvailable
83+
infrastructureTopology: HighlyAvailable
84+
platform: AWS
85+
platformStatus:
86+
aws:
87+
region: us-east-1
88+
ipFamily: DualIPv6Primary
89+
type: AWS
90+
expected: |
91+
apiVersion: config.openshift.io/v1
92+
kind: Infrastructure
93+
spec:
94+
platformSpec:
95+
type: AWS
96+
aws: {}
97+
status:
98+
controlPlaneTopology: HighlyAvailable
99+
cpuPartitioning: None
100+
infrastructureTopology: HighlyAvailable
101+
platform: AWS
102+
platformStatus:
103+
aws:
104+
region: us-east-1
105+
ipFamily: DualIPv6Primary
106+
type: AWS
107+
- name: Should be able to set ipFamily to `DualIPv4Primary` in AWS platform status
108+
initial: |
109+
apiVersion: config.openshift.io/v1
110+
kind: Infrastructure
111+
spec:
112+
platformSpec:
113+
aws: {}
114+
type: AWS
115+
updated: |
116+
apiVersion: config.openshift.io/v1
117+
kind: Infrastructure
118+
spec:
119+
platformSpec:
120+
type: AWS
121+
aws: {}
122+
status:
123+
controlPlaneTopology: HighlyAvailable
124+
infrastructureTopology: HighlyAvailable
125+
platform: AWS
126+
platformStatus:
127+
aws:
128+
region: us-east-1
129+
ipFamily: DualIPv4Primary
130+
type: AWS
131+
expected: |
132+
apiVersion: config.openshift.io/v1
133+
kind: Infrastructure
134+
spec:
135+
platformSpec:
136+
type: AWS
137+
aws: {}
138+
status:
139+
controlPlaneTopology: HighlyAvailable
140+
cpuPartitioning: None
141+
infrastructureTopology: HighlyAvailable
142+
platform: AWS
143+
platformStatus:
144+
aws:
145+
region: us-east-1
146+
ipFamily: DualIPv4Primary
147+
type: AWS
148+
- name: Should not be able to set ipFamily to invalid value in AWS platform status
149+
initial: |
150+
apiVersion: config.openshift.io/v1
151+
kind: Infrastructure
152+
spec:
153+
platformSpec:
154+
aws: {}
155+
type: AWS
156+
updated: |
157+
apiVersion: config.openshift.io/v1
158+
kind: Infrastructure
159+
spec:
160+
platformSpec:
161+
type: AWS
162+
aws: {}
163+
status:
164+
controlPlaneTopology: HighlyAvailable
165+
infrastructureTopology: HighlyAvailable
166+
platform: AWS
167+
platformStatus:
168+
aws:
169+
region: us-east-1
170+
ipFamily: InvalidValue
171+
type: AWS
172+
expectedStatusError: "platformStatus.aws.ipFamily: Unsupported value: \"InvalidValue\": supported values: \"IPv4\", \"DualIPv6Primary\", \"DualIPv4Primary\""
173+
- name: Should not allow changing the immutable ipFamily field in AWS platform status
174+
initial: |
175+
apiVersion: config.openshift.io/v1
176+
kind: Infrastructure
177+
spec:
178+
platformSpec:
179+
aws: {}
180+
type: AWS
181+
status:
182+
controlPlaneTopology: HighlyAvailable
183+
infrastructureTopology: HighlyAvailable
184+
platform: AWS
185+
platformStatus:
186+
aws:
187+
region: us-east-1
188+
ipFamily: IPv4
189+
type: AWS
190+
updated: |
191+
apiVersion: config.openshift.io/v1
192+
kind: Infrastructure
193+
spec:
194+
platformSpec:
195+
type: AWS
196+
aws: {}
197+
status:
198+
controlPlaneTopology: HighlyAvailable
199+
infrastructureTopology: HighlyAvailable
200+
platform: AWS
201+
platformStatus:
202+
aws:
203+
region: us-east-1
204+
ipFamily: DualIPv6Primary
205+
type: AWS
206+
expectedStatusError: "status.platformStatus.aws.ipFamily: Invalid value: \"string\": ipFamily is immutable once set"
207+
- name: Should allow setting the same ipFamily value in AWS platform status
208+
initial: |
209+
apiVersion: config.openshift.io/v1
210+
kind: Infrastructure
211+
spec:
212+
platformSpec:
213+
aws: {}
214+
type: AWS
215+
status:
216+
controlPlaneTopology: HighlyAvailable
217+
infrastructureTopology: HighlyAvailable
218+
platform: AWS
219+
platformStatus:
220+
aws:
221+
region: us-east-1
222+
ipFamily: DualIPv6Primary
223+
type: AWS
224+
updated: |
225+
apiVersion: config.openshift.io/v1
226+
kind: Infrastructure
227+
spec:
228+
platformSpec:
229+
type: AWS
230+
aws: {}
231+
status:
232+
controlPlaneTopology: HighlyAvailable
233+
infrastructureTopology: HighlyAvailable
234+
platform: AWS
235+
platformStatus:
236+
aws:
237+
region: us-east-1
238+
ipFamily: DualIPv6Primary
239+
type: AWS
240+
expected: |
241+
apiVersion: config.openshift.io/v1
242+
kind: Infrastructure
243+
spec:
244+
platformSpec:
245+
type: AWS
246+
aws: {}
247+
status:
248+
controlPlaneTopology: HighlyAvailable
249+
cpuPartitioning: None
250+
infrastructureTopology: HighlyAvailable
251+
platform: AWS
252+
platformStatus:
253+
aws:
254+
region: us-east-1
255+
ipFamily: DualIPv6Primary
256+
type: AWS
257+
- name: Should not be able to unset ipFamily once it has been set in AWS platform status
258+
initial: |
259+
apiVersion: config.openshift.io/v1
260+
kind: Infrastructure
261+
spec:
262+
platformSpec:
263+
aws: {}
264+
type: AWS
265+
status:
266+
controlPlaneTopology: HighlyAvailable
267+
infrastructureTopology: HighlyAvailable
268+
platform: AWS
269+
platformStatus:
270+
aws:
271+
region: us-east-1
272+
ipFamily: IPv4
273+
type: AWS
274+
updated: |
275+
apiVersion: config.openshift.io/v1
276+
kind: Infrastructure
277+
spec:
278+
platformSpec:
279+
type: AWS
280+
aws: {}
281+
status:
282+
controlPlaneTopology: HighlyAvailable
283+
infrastructureTopology: HighlyAvailable
284+
platform: AWS
285+
platformStatus:
286+
aws:
287+
region: us-east-1
288+
type: AWS
289+
expectedStatusError: "status.platformStatus.aws.ipFamily: Invalid value: \"string\": ipFamily is immutable once set"

0 commit comments

Comments
 (0)