-
Notifications
You must be signed in to change notification settings - Fork 32
CLOUDP-351614 - Fix tls deactivation with monitoring #649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
MCK 1.6.2 Release NotesBug Fixes
|
ae774a7 to
9df6415
Compare
| tags: [ "pr_patch", "staging", "e2e_test_suite", "static" ] | ||
| run_on: | ||
| - ubuntu2404-large | ||
| <<: *base_om8_dependency |
There was a problem hiding this comment.
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
2d967f1 to
73a98ff
Compare
When TLS is disabled on AppDB, clear stale TLS params from monitoring config's additionalParams to prevent the monitoring agent from trying to use certificate files that no longer exist. Added addTLSParams/clearTLSParams functions that use shared constants to ensure add and remove operations stay in sync.
73a98ff to
b251f50
Compare
1. Fix type assertion in clearTLSParamsFromMonitoringVersion to handle
both map[string]string (locally created) and map[string]interface{}
(from JSON/API unmarshaling)
2. Fix addMonitoring to update TLS params on existing monitoring entries
when TLS is enabled (previously only added TLS for new entries)
3. Fix trueString constant to be "true" instead of "trueString"
controllers/om/deployment.go
Outdated
| } | ||
| d.AddMonitoring(log, tls, caFilepath) | ||
| d.ConfigureMonitoring(log, tls, caFilepath) | ||
| d.addBackup(log) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: if we are renaming addXXX functions to configureXXX let's do the same for addBackup
| } | ||
| } | ||
|
|
||
| func addMonitoring(ac *automationconfig.AutomationConfig, log *zap.SugaredLogger, tls bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: configureMonitoring
MaciejKaras
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
It's a pity though that we have different object for Deployment in OM and in AppDB so the logic has to be maintained in two places.
| --- | ||
| kind: fix | ||
| date: 2025-12-16 | ||
| --- | ||
|
|
||
| * Fixed an issue where monitoring agents would fail after disabling TLS on a MongoDB deployment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Summary
This pull request fixes the issue: "Monitoring fails to start when disabling TLS"
This pull request addresses a bug where monitoring agents could fail after disabling TLS on a MongoDB deployment, and refactors the code to improve monitoring agent configuration and TLS parameter handling. The changes ensure that TLS-specific parameters are properly cleared when TLS is disabled, preventing monitoring agents from referencing certificate files that no longer exist. The refactor also improves code clarity and reliability by replacing deprecated methods and updating function names to better reflect their behavior.
Proof of Work
Checklist
skip-changeloglabel if not needed