Skip to content

Commit e7a5704

Browse files
committed
API changes to set IPFamily within PlatformStatus of Infra CR
This config is being added to be explicit about the IP address family for the Cluster so that we don't have to infer that from other configs that may not always be present. Updating PlatformStatus for AWS, Azure and GCP to enable dual stack installs on these platforms (initially in tech preview).
1 parent 4a63d62 commit e7a5704

File tree

32 files changed

+16334
-20
lines changed

32 files changed

+16334
-20
lines changed
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
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: ipFamilies should default to `IPFamiliesIPv4` when not specified
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+
type: AWS
33+
updated: |
34+
apiVersion: config.openshift.io/v1
35+
kind: Infrastructure
36+
spec:
37+
platformSpec:
38+
type: AWS
39+
aws: {}
40+
status:
41+
controlPlaneTopology: HighlyAvailable
42+
infrastructureTopology: HighlyAvailable
43+
platform: AWS
44+
platformStatus:
45+
aws: {}
46+
type: AWS
47+
expected: |
48+
apiVersion: config.openshift.io/v1
49+
kind: Infrastructure
50+
spec:
51+
platformSpec:
52+
type: AWS
53+
aws: {}
54+
status:
55+
controlPlaneTopology: HighlyAvailable
56+
cpuPartitioning: None
57+
infrastructureTopology: HighlyAvailable
58+
platform: AWS
59+
platformStatus:
60+
aws:
61+
ipFamilies: IPFamiliesIPv4
62+
type: AWS
63+
- name: should be able to set ipFamilies to non-default value of `IPFamiliesDualStack`
64+
initial: |
65+
apiVersion: config.openshift.io/v1
66+
kind: Infrastructure
67+
spec:
68+
platformSpec:
69+
aws: {}
70+
type: AWS
71+
updated: |
72+
apiVersion: config.openshift.io/v1
73+
kind: Infrastructure
74+
spec:
75+
platformSpec:
76+
type: AWS
77+
aws: {}
78+
status:
79+
controlPlaneTopology: HighlyAvailable
80+
infrastructureTopology: HighlyAvailable
81+
platform: AWS
82+
platformStatus:
83+
aws:
84+
ipFamilies: IPFamiliesDualStack
85+
type: AWS
86+
expected: |
87+
apiVersion: config.openshift.io/v1
88+
kind: Infrastructure
89+
spec:
90+
platformSpec:
91+
type: AWS
92+
aws: {}
93+
status:
94+
controlPlaneTopology: HighlyAvailable
95+
cpuPartitioning: None
96+
infrastructureTopology: HighlyAvailable
97+
platform: AWS
98+
platformStatus:
99+
aws:
100+
ipFamilies: IPFamiliesDualStack
101+
type: AWS
102+
- name: Should not allow changing the immutable ipFamilies field
103+
initial: |
104+
apiVersion: config.openshift.io/v1
105+
kind: Infrastructure
106+
spec:
107+
platformSpec:
108+
aws: {}
109+
type: AWS
110+
status:
111+
controlPlaneTopology: HighlyAvailable
112+
infrastructureTopology: HighlyAvailable
113+
platform: AWS
114+
platformStatus:
115+
aws:
116+
ipFamilies: IPFamiliesDualStack
117+
type: AWS
118+
updated: |
119+
apiVersion: config.openshift.io/v1
120+
kind: Infrastructure
121+
spec:
122+
platformSpec:
123+
type: AWS
124+
aws: {}
125+
status:
126+
controlPlaneTopology: HighlyAvailable
127+
infrastructureTopology: HighlyAvailable
128+
platform: AWS
129+
platformStatus:
130+
aws:
131+
ipFamilies: IPFamiliesIPv4
132+
type: AWS
133+
expectedStatusError: "status.platformStatus.aws.cloudLoadBalancerConfig.dnsType: Invalid value: \"string\": dnsType is immutable"
134+
- name: Should not accept random strings for IpFamilies
135+
initial: |
136+
apiVersion: config.openshift.io/v1
137+
kind: Infrastructure
138+
spec:
139+
platformSpec:
140+
aws: {}
141+
type: AWS
142+
status:
143+
controlPlaneTopology: HighlyAvailable
144+
infrastructureTopology: HighlyAvailable
145+
platform: AWS
146+
platformStatus:
147+
aws:
148+
ipFamilies: IPFamiliesIPv4
149+
type: AWS
150+
updated: |
151+
apiVersion: config.openshift.io/v1
152+
kind: Infrastructure
153+
spec:
154+
platformSpec:
155+
type: AWS
156+
aws: {}
157+
status:
158+
controlPlaneTopology: HighlyAvailable
159+
infrastructureTopology: HighlyAvailable
160+
platform: AWS
161+
platformStatus:
162+
aws:
163+
ipFamilies: "OpenShift"
164+
type: AWS
165+
expectedStatusError: "status.platformStatus.aws.ipFamilies: Invalid value: \"string\": value must be a valid IP address"
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
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+
- AzureDualStackInstall
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: ipFamilies should default to `IPFamiliesIPv4` when not specified
19+
initial: |
20+
apiVersion: config.openshift.io/v1
21+
kind: Infrastructure
22+
spec:
23+
platformSpec:
24+
azure: {}
25+
type: Azure
26+
status:
27+
controlPlaneTopology: HighlyAvailable
28+
infrastructureTopology: HighlyAvailable
29+
platform: Azure
30+
platformStatus:
31+
azure: {}
32+
type: Azure
33+
updated: |
34+
apiVersion: config.openshift.io/v1
35+
kind: Infrastructure
36+
spec:
37+
platformSpec:
38+
type: Azure
39+
azure: {}
40+
status:
41+
controlPlaneTopology: HighlyAvailable
42+
infrastructureTopology: HighlyAvailable
43+
platform: Azure
44+
platformStatus:
45+
azure: {}
46+
type: Azure
47+
expected: |
48+
apiVersion: config.openshift.io/v1
49+
kind: Infrastructure
50+
spec:
51+
platformSpec:
52+
type: Azure
53+
azure: {}
54+
status:
55+
controlPlaneTopology: HighlyAvailable
56+
cpuPartitioning: None
57+
infrastructureTopology: HighlyAvailable
58+
platform: Azure
59+
platformStatus:
60+
azure:
61+
ipFamilies: IPFamiliesIPv4
62+
type: Azure
63+
- name: should be able to set ipFamilies to non-default value of `IPFamiliesDualStack`
64+
initial: |
65+
apiVersion: config.openshift.io/v1
66+
kind: Infrastructure
67+
spec:
68+
platformSpec:
69+
azure: {}
70+
type: Azure
71+
updated: |
72+
apiVersion: config.openshift.io/v1
73+
kind: Infrastructure
74+
spec:
75+
platformSpec:
76+
type: Azure
77+
azure: {}
78+
status:
79+
controlPlaneTopology: HighlyAvailable
80+
infrastructureTopology: HighlyAvailable
81+
platform: Azure
82+
platformStatus:
83+
azure:
84+
ipFamilies: IPFamiliesDualStack
85+
type: Azure
86+
expected: |
87+
apiVersion: config.openshift.io/v1
88+
kind: Infrastructure
89+
spec:
90+
platformSpec:
91+
type: Azure
92+
azure: {}
93+
status:
94+
controlPlaneTopology: HighlyAvailable
95+
cpuPartitioning: None
96+
infrastructureTopology: HighlyAvailable
97+
platform: Azure
98+
platformStatus:
99+
azure:
100+
ipFamilies: IPFamiliesDualStack
101+
type: Azure
102+
- name: Should not allow changing the immutable ipFamilies field
103+
initial: |
104+
apiVersion: config.openshift.io/v1
105+
kind: Infrastructure
106+
spec:
107+
platformSpec:
108+
azure: {}
109+
type: Azure
110+
status:
111+
controlPlaneTopology: HighlyAvailable
112+
infrastructureTopology: HighlyAvailable
113+
platform: Azure
114+
platformStatus:
115+
azure:
116+
ipFamilies: IPFamiliesDualStack
117+
type: Azure
118+
updated: |
119+
apiVersion: config.openshift.io/v1
120+
kind: Infrastructure
121+
spec:
122+
platformSpec:
123+
type: Azure
124+
azure: {}
125+
status:
126+
controlPlaneTopology: HighlyAvailable
127+
infrastructureTopology: HighlyAvailable
128+
platform: Azure
129+
platformStatus:
130+
azure:
131+
ipFamilies: IPFamiliesIPv4
132+
type: Azure
133+
expectedStatusError: "status.platformStatus.azure.cloudLoadBalancerConfig.dnsType: Invalid value: \"string\": dnsType is immutable"
134+
- name: Should not accept random strings for IpFamilies
135+
initial: |
136+
apiVersion: config.openshift.io/v1
137+
kind: Infrastructure
138+
spec:
139+
platformSpec:
140+
azure: {}
141+
type: Azure
142+
status:
143+
controlPlaneTopology: HighlyAvailable
144+
infrastructureTopology: HighlyAvailable
145+
platform: Azure
146+
platformStatus:
147+
azure:
148+
ipFamilies: IPFamiliesIPv4
149+
type: Azure
150+
updated: |
151+
apiVersion: config.openshift.io/v1
152+
kind: Infrastructure
153+
spec:
154+
platformSpec:
155+
type: Azure
156+
azure: {}
157+
status:
158+
controlPlaneTopology: HighlyAvailable
159+
infrastructureTopology: HighlyAvailable
160+
platform: Azure
161+
platformStatus:
162+
azure:
163+
ipFamilies: "OpenShift"
164+
type: Azure
165+
expectedStatusError: "status.platformStatus.azure.ipFamilies: Invalid value: \"string\": value must be a valid IP address"

0 commit comments

Comments
 (0)