Skip to content

Conversation

@anandsyncs
Copy link
Contributor

@anandsyncs anandsyncs commented Oct 26, 2025

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] [2]
  • Improved image tag extraction logic to reliably determine the version from container image references. [1] [2]

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] [2] [3] [4]

Proof of Work

Tests pass

Checklist

  • Have you linked a jira ticket and/or is the ticket in the title?
  • Have you checked whether your jira ticket required DOCSP changes?
  • Have you added changelog file?

@github-actions
Copy link

github-actions bot commented Oct 26, 2025

⚠️ (this preview might not be accurate if the PR is not rebased on current master branch)

MCK 1.6.0 Release Notes

New Features

  • MongoDBCommunity: Added support to configure custom cluster domain via newly introduced spec.clusterDomain resource field. If spec.clusterDomain is not set, environment variable CLUSTER_DOMAIN is used as cluster domain. If the environment variable CLUSTER_DOMAIN is also not set, operator falls back to cluster.local as default cluster domain.
  • Helm Chart: Introduced two new helm fields operator.podSecurityContext and operator.securityContext that can be used to configure securityContext for Operator deployment through Helm Chart.
  • MongoDBSearch: Switch to gRPC and mTLS for internal communication
    Since MCK 1.4 the mongod and mongot processess communicated using the MongoDB Wire Protocol and used keyfile authentication. This release switches that to gRPC with mTLS authentication. gRPC will allow for load-balancing search queries against multiple mongot processes in the future, and mTLS decouples the internal cluster authentication mode and credentials among mongod processes from the connection to the mongot process. The Operator will automatically enable gRPC for existing and new workloads, and will enable mTLS authentication if both Database Server and MongoDBSearch resource are configured for TLS.
  • MongoDBSearch: MongoDB deployments using X509 internal cluster authentication are now supported. Previously MongoDB Search required SCRAM authentication among members of a MongoDB replica set. Note: SCRAM client authentication is still required, this change merely relaxes the requirements on internal cluster authentication.
  • MongoDBSearch: Updated the default mongodb/mongodb-search image version to 0.55.0. This is the version MCK uses if .spec.version is not specified.

Bug Fixes

  • Fixed parsing of the customEnvVars Helm value when values contain = characters.
  • ReplicaSet: Blocked disabling TLS and changing member count simultaneously. These operations must now be applied separately to prevent configuration inconsistencies.
  • MongoDBSearch now records the reconciled mongot version in status and exposes it via a dedicated kubectl print column.
  • Fixed inability to specify cluster-wide privileges in custom roles.

Other Changes

  • Simplified MongoDB Search setup: Removed the custom Search Coordinator polyfill (a piece of compatibility code previously needed to add the required permissions), as MongoDB 8.2.0 and later now include the necessary permissions via the built-in searchCoordinator role.
  • kubectl-mongodb plugin: cosign, the signing tool that is used to sign kubectl-mongodb plugin binaries, has been updated to version 3.0.2. With this change, released binaries will be bundled with .bundle files containing both signature and certificate information. For more information on how to verify signatures using new cosign version please refer to -> https://github.com/sigstore/cosign/blob/v3.0.2/doc/cosign_verify-blob.md

@anandsyncs anandsyncs force-pushed the CLOUDP-327089-add-status-field branch from 2536abe to ae52bb4 Compare October 28, 2025 09:57
@anandsyncs anandsyncs marked this pull request as ready for review October 28, 2025 09:58
@anandsyncs anandsyncs requested review from a team and vinilage as code owners October 28, 2025 09:58
Copy link
Collaborator

@vinilage vinilage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment on lines +1 to +7
---
title: Surface reconciled MongoDBSearch version
kind: fix
date: 2025-10-24
---

* MongoDBSearch now records the reconciled mongot version in status and exposes it via a dedicated kubectl print column.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@anandsyncs anandsyncs merged commit 412399f into master Nov 10, 2025
8 of 10 checks passed
@anandsyncs anandsyncs deleted the CLOUDP-327089-add-status-field branch November 10, 2025 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants