...
1apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
2name: "[TechPreviewNoUpgrade] Infrastructure"
3crd: 0000_10_config-operator_01_infrastructure-TechPreviewNoUpgrade.crd.yaml
4tests:
5 onCreate:
6 - name: Should be able to create a minimal Infrastructure
7 initial: |
8 apiVersion: config.openshift.io/v1
9 kind: Infrastructure
10 spec: {} # No spec is required for a Infrastructure
11 expected: |
12 apiVersion: config.openshift.io/v1
13 kind: Infrastructure
14 spec: {}
15 onUpdate:
16 - name: Status Should contain default fields
17 initial: |
18 apiVersion: config.openshift.io/v1
19 kind: Infrastructure
20 spec: {}
21 status: {}
22 updated: |
23 apiVersion: config.openshift.io/v1
24 kind: Infrastructure
25 spec: {}
26 status: {}
27 expected: |
28 apiVersion: config.openshift.io/v1
29 kind: Infrastructure
30 spec: {}
31 status:
32 cpuPartitioning: None
33 infrastructureTopology: HighlyAvailable
34 controlPlaneTopology: HighlyAvailable
35 - name: Status update cpuPartitioning should fail validation check
36 initial: |
37 apiVersion: config.openshift.io/v1
38 kind: Infrastructure
39 spec: {}
40 status:
41 cpuPartitioning: None
42 updated: |
43 apiVersion: config.openshift.io/v1
44 kind: Infrastructure
45 spec: {}
46 status:
47 cpuPartitioning: "Invalid"
48 expectedStatusError: 'status.cpuPartitioning: Unsupported value: "Invalid": supported values: "None", "AllNodes"'
49 - name: Should set load balancer type to OpenShiftManagedDefault if not specified
50 initial: |
51 apiVersion: config.openshift.io/v1
52 kind: Infrastructure
53 spec:
54 platformSpec:
55 baremetal: {}
56 type: BareMetal
57 updated: |
58 apiVersion: config.openshift.io/v1
59 kind: Infrastructure
60 spec:
61 platformSpec:
62 baremetal: {}
63 type: BareMetal
64 status:
65 platform: BareMetal
66 platformStatus:
67 baremetal: {}
68 type: BareMetal
69 expected: |
70 apiVersion: config.openshift.io/v1
71 kind: Infrastructure
72 spec:
73 platformSpec:
74 baremetal: {}
75 type: BareMetal
76 status:
77 controlPlaneTopology: HighlyAvailable
78 cpuPartitioning: None
79 infrastructureTopology: HighlyAvailable
80 platform: BareMetal
81 platformStatus:
82 baremetal:
83 loadBalancer:
84 type: OpenShiftManagedDefault
85 type: BareMetal
86 - name: Should be able to override the default load balancer with a valid value
87 initial: |
88 apiVersion: config.openshift.io/v1
89 kind: Infrastructure
90 spec:
91 platformSpec:
92 baremetal: {}
93 type: BareMetal
94 updated: |
95 apiVersion: config.openshift.io/v1
96 kind: Infrastructure
97 spec:
98 platformSpec:
99 baremetal: {}
100 type: BareMetal
101 status:
102 platform: BareMetal
103 platformStatus:
104 baremetal:
105 loadBalancer:
106 type: UserManaged
107 type: BareMetal
108 expected: |
109 apiVersion: config.openshift.io/v1
110 kind: Infrastructure
111 spec:
112 platformSpec:
113 baremetal: {}
114 type: BareMetal
115 status:
116 controlPlaneTopology: HighlyAvailable
117 cpuPartitioning: None
118 infrastructureTopology: HighlyAvailable
119 platform: BareMetal
120 platformStatus:
121 baremetal:
122 loadBalancer:
123 type: UserManaged
124 type: BareMetal
125 - name: Should not allow changing the immutable load balancer type field
126 initial: |
127 apiVersion: config.openshift.io/v1
128 kind: Infrastructure
129 spec:
130 platformSpec:
131 baremetal: {}
132 type: BareMetal
133 status:
134 controlPlaneTopology: HighlyAvailable
135 infrastructureTopology: HighlyAvailable
136 platform: BareMetal
137 platformStatus:
138 baremetal:
139 loadBalancer:
140 type: OpenShiftManagedDefault
141 type: BareMetal
142 updated: |
143 apiVersion: config.openshift.io/v1
144 kind: Infrastructure
145 spec:
146 platformSpec:
147 type: BareMetal
148 baremetal: {}
149 status:
150 controlPlaneTopology: HighlyAvailable
151 infrastructureTopology: HighlyAvailable
152 platform: BareMetal
153 platformStatus:
154 baremetal:
155 loadBalancer:
156 type: UserManaged
157 type: BareMetal
158 expectedStatusError: "status.platformStatus.baremetal.loadBalancer.type: Invalid value: \"string\": type is immutable once set"
159 - name: Should not allow removing the immutable load balancer type field that was initially set
160 initial: |
161 apiVersion: config.openshift.io/v1
162 kind: Infrastructure
163 spec:
164 platformSpec:
165 baremetal: {}
166 type: BareMetal
167 status:
168 controlPlaneTopology: HighlyAvailable
169 infrastructureTopology: HighlyAvailable
170 platform: BareMetal
171 platformStatus:
172 baremetal:
173 loadBalancer:
174 type: UserManaged
175 type: BareMetal
176 updated: |
177 apiVersion: config.openshift.io/v1
178 kind: Infrastructure
179 spec:
180 platformSpec:
181 type: BareMetal
182 baremetal: {}
183 status:
184 controlPlaneTopology: HighlyAvailable
185 infrastructureTopology: HighlyAvailable
186 platform: BareMetal
187 platformStatus:
188 baremetal: {}
189 type: BareMetal
190 expectedStatusError: "status.platformStatus.baremetal.loadBalancer.type: Invalid value: \"string\": type is immutable once set"
191 - name: Should not allow setting the load balancer type to a wrong value
192 initial: |
193 apiVersion: config.openshift.io/v1
194 kind: Infrastructure
195 spec:
196 platformSpec:
197 baremetal: {}
198 type: BareMetal
199 updated: |
200 apiVersion: config.openshift.io/v1
201 kind: Infrastructure
202 spec:
203 platformSpec:
204 baremetal: {}
205 type: BareMetal
206 status:
207 platform: BareMetal
208 platformStatus:
209 baremetal:
210 loadBalancer:
211 type: FooBar
212 type: BareMetal
213 expectedStatusError: "status.platformStatus.baremetal.loadBalancer.type: Unsupported value: \"FooBar\": supported values: \"OpenShiftManagedDefault\", \"UserManaged\""
View as plain text