Commit c7db35d
committed
status: Conditionally add CRDs to relatedObjects
Check whether the gatewayclasses, gateways, and istios CRDs actually
exist before adding them to relatedObjects.
Also, use the "GatewayAPIController" featuregate to determine whether
to add the the gateways, istios, and subscriptions resources to
relatedObjects, rather than using the "GatewayAPI" featuregate.
Before this change, the operator could add istios to relatedObjects even
if the OSSM subscription failed to install. By convention, an operator
should only add resources to relatedObjects if those resources exist.
This commit fixes OCPBUGS-54745.
https://issues.redhat.com/browse/OCPBUGS-54745
* pkg/operator/controller/status/controller.go
(gatewaysResourceName, gatewayclassesResourceName, istiosResourceName):
New consts for the CRD names.
(relatedObjectsCRDs): New var for a string set that contains
gatewaysResourceName, gatewayclassesResourceName, and istiosResourceName.
(New): Add a watch on CRDs, with a predicate for CRDs with names that
are in relatedObjectsCRDs.
(Config): Add GatewayAPIControllerEnabled.
(Reconcile): Check haveGatewayclassesResource, haveGatewaysResource, and
haveIstiosResource in the operatorState object and conditionally add the
corresponding resources to relatedObjectsCRDs.
(operatorState): Add haveGatewaysResource, haveGatewayclassesResource,
and haveIstiosResource fields.
(getOperatorState): Set haveGatewaysResource,
haveGatewayclassesResource, and haveIstiosResource.
* pkg/operator/operator.go (New): Specify GatewayAPIControllerEnabled in
the status controller config.
* test/e2e/operator_test.go (TestClusterOperatorStatusRelatedObjects):
Expect to see gateways if the "GatewayAPIControllerEnabled" featuregate
is enabled.1 parent 500f13e commit c7db35d
File tree
3 files changed
+118
-25
lines changed- pkg/operator
- controller/status
- test/e2e
3 files changed
+118
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
52 | 62 | | |
53 | 63 | | |
54 | 64 | | |
55 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
56 | 70 | | |
57 | | - | |
58 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
59 | 75 | | |
60 | 76 | | |
61 | 77 | | |
| |||
115 | 131 | | |
116 | 132 | | |
117 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
118 | 152 | | |
119 | 153 | | |
120 | 154 | | |
| |||
123 | 157 | | |
124 | 158 | | |
125 | 159 | | |
126 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
127 | 164 | | |
128 | 165 | | |
129 | 166 | | |
| |||
199 | 236 | | |
200 | 237 | | |
201 | 238 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
| 239 | + | |
208 | 240 | | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
| 241 | + | |
| 242 | + | |
213 | 243 | | |
214 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
215 | 248 | | |
216 | | - | |
217 | | - | |
218 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
219 | 259 | | |
| 260 | + | |
| 261 | + | |
220 | 262 | | |
221 | 263 | | |
222 | 264 | | |
| |||
295 | 337 | | |
296 | 338 | | |
297 | 339 | | |
| 340 | + | |
298 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
299 | 350 | | |
300 | 351 | | |
301 | 352 | | |
| |||
338 | 389 | | |
339 | 390 | | |
340 | 391 | | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
341 | 423 | | |
342 | 424 | | |
343 | 425 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
216 | 217 | | |
217 | 218 | | |
218 | 219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
241 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
242 | 252 | | |
243 | 253 | | |
244 | 254 | | |
| |||
0 commit comments