Skip to content

Conversation

@lucian-tosa
Copy link
Contributor

@lucian-tosa lucian-tosa commented Dec 4, 2025

Summary

This PR fixes an issue where roles added to an OM project outside the operator (through UI or the API) are overwritten by the operator every reconciliation. This is now consistent with the user behaviour, where users can be defined in the UI and will not be removed.

To accomplish this, we are now tracking the roles we configure with the operator in an annotation, and state configmap (where applicable). This was necessary due to possible usage of the ClusterMongoDBRole resource. If the reference to a role resource is removed at the same time as removing the resource itself, then it is not possible to determine which role needs to be removed from the automation config without knowing the previous set of roles.

Proof of Work

Unit tests have been added to verify that the ensureRoles method which is reused across all controllers behaves correctly. Additionally, the unit tests verify that each controller keeps track of the previously configured roles in an annotation.

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 Dec 4, 2025

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

MCK 1.6.1 Release Notes

Bug Fixes

  • Backed up the agent password in a secret for SCRAM authentication to prevent unnecessary password rotations.
  • Roles configured via Ops Manager UI or API will no longer be removed by the operator

@lucian-tosa lucian-tosa marked this pull request as ready for review December 4, 2025 16:49
@lucian-tosa lucian-tosa requested review from a team and vinilage as code owners December 4, 2025 16:49
@lucian-tosa lucian-tosa requested review from lsierant and nammn December 4, 2025 16:49
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.

2 participants