Skip to content

Conversation

@nammn
Copy link
Collaborator

@nammn nammn commented Dec 16, 2025

Summary

This pull request improves the handling of TLS parameters in monitoring configuration, ensuring that TLS-related settings are properly cleared when TLS is disabled. It also adds a dedicated test to verify this behavior.

TLS Parameter Handling Improvements:

  • In deployment.go, when TLS is disabled, the "additionalParams" key is now removed from the monitoring configuration to prevent monitoring agents from referencing non-existent certificate files.
  • In appdbreplicaset_controller.go, the code explicitly clears the AdditionalParams field for each monitoring version when TLS is disabled, further ensuring that leftover TLS settings are not retained.

Testing Enhancements:

  • A new test, TestAddMonitoringTLSDisable, was added to deployment_test.go to verify that enabling and then disabling TLS correctly adds and then removes TLS parameters from the monitoring configuration.

Proof of Work

  • green patch

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

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

MCK 1.6.2 Release Notes

Bug Fixes

  • Fixed an issue where monitoring agents would fail after disabling TLS on a MongoDB deployment.

tags: [ "pr_patch", "staging", "e2e_test_suite", "static" ]
run_on:
- ubuntu2404-large
<<: *base_om8_dependency
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

revert me once the image build has been fixed for the database image

When TLS is disabled on AppDB, the operator now correctly clears stale
TLS parameters (additionalParams) from the monitoring configuration.

Before this fix, stale TLS params like useSslForAllConnections and
sslClientCertificate would remain in the monitoring config after TLS
was disabled, causing monitoring agents to fail when trying to use
certificate files that are no longer valid for authentication.

Changes:
- deployment.go: Clear additionalParams when TLS is disabled
- appdbreplicaset_controller.go: Use correct TLS state for monitoring
- Added e2e test (e2e_om_appdb_tls_disable) that verifies:
  1. TLS params are present when TLS is enabled
  2. TLS params are cleared after TLS is disabled
  3. Monitoring continues to work after TLS disable
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