Commit 412399f
authored
CLOUDP: 327089, CLOUDP: 317939 add status field (#554)
# Summary
This pull request introduces support for tracking and updating the
reconciled MongoDB Search version within the operator and its CRD
status. The changes ensure that the `Status.Version` field is set only
after the StatefulSet becomes ready, and add mechanisms to pass and
validate the version throughout the reconciliation workflow. Additional
test coverage verifies the correct behavior before and after readiness.
**CRD and Status Enhancements:**
* Added a new `Version` column to the `MongoDBSearch` CRD for visibility
in `kubectl get` output.
* Updated the `UpdateStatus` method to accept and set the
`MongoDBSearchVersionOption`, allowing the controller to update the
reconciled version in status.
* Introduced `MongoDBSearchVersionOption` and related helpers in
`status_options.go` to encapsulate version updates for status.
**Controller and Reconciliation Logic:**
* Refactored reconciliation to extract and validate the mongot version,
and propagate it to status only after the StatefulSet is marked ready.
[[1]](diffhunk://#diff-9b1183581cc6af6723f6445d7a14ae4ae7b435dc3b93ca5d82247cda13f7ca39L92-R94)
[[2]](diffhunk://#diff-9b1183581cc6af6723f6445d7a14ae4ae7b435dc3b93ca5d82247cda13f7ca39L140-R142)
* Improved image tag extraction logic to reliably determine the version
from container image references.
[[1]](diffhunk://#diff-9b1183581cc6af6723f6445d7a14ae4ae7b435dc3b93ca5d82247cda13f7ca39L438-R456)
[[2]](diffhunk://#diff-9b1183581cc6af6723f6445d7a14ae4ae7b435dc3b93ca5d82247cda13f7ca39L464-R485)
**Testing Improvements:**
* Enhanced the reconciliation test to verify that `Status.Version`
remains empty before readiness and is set correctly after the
StatefulSet is ready; added a helper to simulate readiness.
[[1]](diffhunk://#diff-99deace5d42a2301ad297432b8bc207298dcbd4dd94974ec95bcdbc0f4fcd885L175-R180)
[[2]](diffhunk://#diff-99deace5d42a2301ad297432b8bc207298dcbd4dd94974ec95bcdbc0f4fcd885R190-R194)
[[3]](diffhunk://#diff-99deace5d42a2301ad297432b8bc207298dcbd4dd94974ec95bcdbc0f4fcd885L197-R218)
[[4]](diffhunk://#diff-99deace5d42a2301ad297432b8bc207298dcbd4dd94974ec95bcdbc0f4fcd885R318-R332)
## Proof of Work
Tests pass1 parent 7272a43 commit 412399f
File tree
6 files changed
+85
-21
lines changed- api/v1/search
- changelog
- controllers
- operator
- searchcontroller
- scripts/release/build
6 files changed
+85
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
| |||
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
148 | 152 | | |
149 | 153 | | |
150 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
182 | | - | |
183 | 181 | | |
184 | 182 | | |
185 | 183 | | |
186 | 184 | | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
| 185 | + | |
| 186 | + | |
195 | 187 | | |
196 | 188 | | |
197 | 189 | | |
198 | 190 | | |
| 191 | + | |
199 | 192 | | |
200 | 193 | | |
201 | 194 | | |
202 | 195 | | |
203 | 196 | | |
204 | 197 | | |
205 | 198 | | |
206 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
207 | 205 | | |
208 | 206 | | |
209 | 207 | | |
| |||
213 | 211 | | |
214 | 212 | | |
215 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
216 | 219 | | |
217 | 220 | | |
218 | 221 | | |
| |||
234 | 237 | | |
235 | 238 | | |
236 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
237 | 253 | | |
238 | 254 | | |
239 | 255 | | |
| |||
Lines changed: 29 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
| |||
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
140 | | - | |
| 142 | + | |
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
| |||
449 | 451 | | |
450 | 452 | | |
451 | 453 | | |
452 | | - | |
453 | | - | |
454 | | - | |
| 454 | + | |
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
459 | 459 | | |
460 | 460 | | |
461 | 461 | | |
462 | | - | |
| 462 | + | |
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
468 | | - | |
469 | | - | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
470 | 471 | | |
471 | 472 | | |
472 | 473 | | |
| |||
475 | 476 | | |
476 | 477 | | |
477 | 478 | | |
478 | | - | |
| 479 | + | |
479 | 480 | | |
480 | 481 | | |
481 | 482 | | |
482 | 483 | | |
483 | 484 | | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
0 commit comments