Skip to content

Commit fb36988

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 5e1eb05 commit fb36988

File tree

36 files changed

+16503
-0
lines changed

36 files changed

+16503
-0
lines changed

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

Lines changed: 3 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: |
@@ -84,6 +85,7 @@ tests:
8485
aws:
8586
cloudLoadBalancerConfig:
8687
dnsType: ClusterHosted
88+
ipFamily: IPv4
8789
type: AWS
8890
expected: |
8991
apiVersion: config.openshift.io/v1
@@ -101,6 +103,7 @@ tests:
101103
aws:
102104
cloudLoadBalancerConfig:
103105
dnsType: ClusterHosted
106+
ipFamily: IPv4
104107
type: AWS
105108
- name: Should not allow changing the immutable dnsType field
106109
initial: |

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

Lines changed: 3 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: |
@@ -84,6 +85,7 @@ tests:
8485
aws:
8586
cloudLoadBalancerConfig:
8687
dnsType: ClusterHosted
88+
ipFamily: IPv4
8789
type: AWS
8890
expected: |
8991
apiVersion: config.openshift.io/v1
@@ -101,6 +103,7 @@ tests:
101103
aws:
102104
cloudLoadBalancerConfig:
103105
dnsType: ClusterHosted
106+
ipFamily: IPv4
104107
type: AWS
105108
- name: Should not allow changing the immutable dnsType field
106109
initial: |
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
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
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+
cloudLoadBalancerConfig:
62+
dnsType: PlatformDefault
63+
ipFamily: IPv4
64+
type: AWS
65+
- name: should be able to set ipFamily to non-default value of `DualStack`
66+
initial: |
67+
apiVersion: config.openshift.io/v1
68+
kind: Infrastructure
69+
spec:
70+
platformSpec:
71+
aws: {}
72+
type: AWS
73+
updated: |
74+
apiVersion: config.openshift.io/v1
75+
kind: Infrastructure
76+
spec:
77+
platformSpec:
78+
type: AWS
79+
aws: {}
80+
status:
81+
controlPlaneTopology: HighlyAvailable
82+
infrastructureTopology: HighlyAvailable
83+
platform: AWS
84+
platformStatus:
85+
aws:
86+
ipFamily: DualStack
87+
type: AWS
88+
expected: |
89+
apiVersion: config.openshift.io/v1
90+
kind: Infrastructure
91+
spec:
92+
platformSpec:
93+
type: AWS
94+
aws: {}
95+
status:
96+
controlPlaneTopology: HighlyAvailable
97+
cpuPartitioning: None
98+
infrastructureTopology: HighlyAvailable
99+
platform: AWS
100+
platformStatus:
101+
aws:
102+
cloudLoadBalancerConfig:
103+
dnsType: PlatformDefault
104+
ipFamily: DualStack
105+
type: AWS
106+
- name: Should not allow changing the immutable ipFamily field
107+
initial: |
108+
apiVersion: config.openshift.io/v1
109+
kind: Infrastructure
110+
spec:
111+
platformSpec:
112+
aws: {}
113+
type: AWS
114+
status:
115+
controlPlaneTopology: HighlyAvailable
116+
infrastructureTopology: HighlyAvailable
117+
platform: AWS
118+
platformStatus:
119+
aws:
120+
ipFamily: DualStack
121+
type: AWS
122+
updated: |
123+
apiVersion: config.openshift.io/v1
124+
kind: Infrastructure
125+
spec:
126+
platformSpec:
127+
type: AWS
128+
aws: {}
129+
status:
130+
controlPlaneTopology: HighlyAvailable
131+
infrastructureTopology: HighlyAvailable
132+
platform: AWS
133+
platformStatus:
134+
aws:
135+
ipFamily: IPv4
136+
type: AWS
137+
expectedStatusError: "status.platformStatus.aws.ipFamily: Invalid value: \"string\": ipFamily is immutable once set"
138+
- name: Should not accept random strings for IpFamily
139+
initial: |
140+
apiVersion: config.openshift.io/v1
141+
kind: Infrastructure
142+
spec:
143+
platformSpec:
144+
aws: {}
145+
type: AWS
146+
status:
147+
controlPlaneTopology: HighlyAvailable
148+
infrastructureTopology: HighlyAvailable
149+
platform: AWS
150+
platformStatus:
151+
aws:
152+
ipFamily: IPv4
153+
type: AWS
154+
updated: |
155+
apiVersion: config.openshift.io/v1
156+
kind: Infrastructure
157+
spec:
158+
platformSpec:
159+
type: AWS
160+
aws: {}
161+
status:
162+
controlPlaneTopology: HighlyAvailable
163+
infrastructureTopology: HighlyAvailable
164+
platform: AWS
165+
platformStatus:
166+
aws:
167+
ipFamily: "OpenShift"
168+
type: AWS
169+
expectedStatusError: "status.platformStatus.aws.ipFamily: Unsupported value: \"OpenShift\": supported values: \"IPv4\", \"DualStack\""

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

Lines changed: 3 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: |
@@ -84,6 +85,7 @@ tests:
8485
azure:
8586
cloudLoadBalancerConfig:
8687
dnsType: ClusterHosted
88+
ipFamily: IPv4
8789
type: Azure
8890
expected: |
8991
apiVersion: config.openshift.io/v1
@@ -101,6 +103,7 @@ tests:
101103
azure:
102104
cloudLoadBalancerConfig:
103105
dnsType: ClusterHosted
106+
ipFamily: IPv4
104107
type: Azure
105108
- name: Should not allow changing the immutable dnsType field
106109
initial: |

0 commit comments

Comments
 (0)