Remove manual CertReloader wiring#6946
Draft
ycombinator wants to merge 2 commits into
Draft
Conversation
LoadTLSServerConfig in elastic-agent-libs now handles CertReloader setup internally (elastic/elastic-agent-libs#417), making the manual wiring in server.go redundant. This also removes the local resolvePassphrase helper which is now handled by the library. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
This pull request does not have a backport label. Could you fix it @ycombinator? 🙏
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the problem this PR solves?
PR #6838 added TLS certificate hot-reload support to fleet-server by manually wiring up a
CertReloaderinserver.go. This manual wiring duplicates logic that now lives inelastic-agent-libs(via elastic/elastic-agent-libs#417), which wiresCertReloaderinto bothLoadTLSServerConfig(server-side) andLoadTLSConfig(client-side) automatically. Having the wiring in both places is redundant and means fleet-server carries passphrase resolution and reloader option-building code that the library already handles.How does this PR solve the problem?
Removes the manual
CertReloadersetup block fromserver.Run()and the localresolvePassphrasehelper function.LoadTLSServerConfignow returns aTLSConfigwithcertReloaderalready configured, andBuildServerConfig()automatically setsGetCertificateon the resultingtls.Config. No behavioral change — certificate hot-reload continues to work exactly as before.Note that elastic/elastic-agent-libs#417 also wires up client-side certificate reloading via
LoadTLSConfig→ToConfig(), which setsGetClientCertificateon the resultingtls.Config. This means fleet-server's client-side TLS connections to Elasticsearch (viahttpcommon.HTTPTransportSettings.RoundTripper()) also get automatic certificate hot-reload without any code changes in fleet-server.How to test this PR locally
The existing
Test_server_TLSCertReloadintegration test validates that certificate reload works end-to-end. Run it with:Design Checklist
Checklist
Related issues
🤖 Generated with Claude Code