You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 pass
Copy file name to clipboardExpand all lines: api/v1/search/mongodbsearch_types.go
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,7 @@ type MongoDBSearchStatus struct {
105
105
// +k8s:openapi-gen=true
106
106
// +kubebuilder:subresource:status
107
107
// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Current state of the MongoDB deployment."
108
+
// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".status.version",description="MongoDB Search version reconciled by the operator."
108
109
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="The time since the MongoDB resource was created."
0 commit comments