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-321075: fail to reconcile mongo db search for version 1.47.0 (#244)
# Summary
This pull request introduces validation for unsupported MongoDBSearch
image versions and adds a corresponding test case. The key changes
include implementing a new validation method, updating the
reconciliation logic, and adding constants for unsupported versions.
### Validation for unsupported MongoDBSearch image versions:
* **New validation method**: Added `ValidateSearchImageVersion` to
`MongoDBSearchReconcileHelper` to check if the specified or container
image version matches an unsupported version (`1.47.0`). If so, it
returns an error.
* **Integration into reconciliation workflow**: Updated the `reconcile`
method to invoke `ValidateSearchImageVersion` before proceeding with
other validations.
* **Constants for unsupported version**: Introduced
`unsupportedSearchVersion` and `unsupportedSearchVersionErrorFmt`
constants to centralize the unsupported version logic and error
formatting.
### Test case for validation:
* **New test**: Added
`TestMongoDBSearchReconcile_InvalidSearchImageVersion` to validate the
error handling for unsupported MongoDBSearch versions. This ensures the
reconciliation fails with the appropriate error message.
## Proof of Work
Test pass
## Checklist
- [x] Have you linked a jira ticket and/or is the ticket in the title?
- [x] Have you checked whether your jira ticket required DOCSP changes?
- [x] Have you checked for release_note changes?
expectedMsg:="MongoDBSearch version 1.47.0 is not supported because of breaking changes. The operator will ignore this resource: it will not reconcile or reconfigure the workload. Existing deployments will continue to run, but cannot be managed by the operator. To regain operator management, you must delete and recreate the MongoDBSearch resource."
246
+
247
+
tests:= []struct {
248
+
namestring
249
+
specVersionstring
250
+
operatorVersionstring
251
+
statefulSetConfig*common.StatefulSetConfiguration
252
+
}{
253
+
{
254
+
name: "unsupported version in Spec.Version",
255
+
specVersion: "1.47.0",
256
+
},
257
+
{
258
+
name: "unsupported version in operator config",
259
+
operatorVersion: "1.47.0",
260
+
},
261
+
{
262
+
name: "unsupported version in StatefulSetConfiguration",
0 commit comments