Remove manual CertReloader wiring#6946
Merged
ycombinator merged 2 commits intoMay 20, 2026
Merged
Conversation
Contributor
|
This pull request does not have a backport label. Could you fix it @ycombinator? 🙏
|
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>
bc2bc53 to
b8be8e8
Compare
ebeahan
approved these changes
May 20, 2026
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 by manually wiring a
CertReloaderinserver.go. That manual wiring now causes a startup failure when TLS certificates are passed as inline PEMs (rather than file paths).The root cause: elastic-agent-libs v0.43.0 (shipped via #7054) added an
IsPEMStringguard toNewCertReloaderthat rejects inline PEM strings — correctly, since there is nothing to reload from disk. But fleet-server'sserver.gocallsNewCertReloaderunconditionally wheneverCertificateReload.IsEnabled()(which istrueby default), without checking whether the cert is a file path or an inline PEM. The result:This broke the Kibana CI OSQuery Cypress tests (kibana-package-registry-verify-and-promote/builds/533), where fleet-server is configured with inline PEM certificates.
How does this PR solve the problem?
Removes the manual
CertReloadersetup block fromserver.Run()and the localresolvePassphrasehelper. As of elastic-agent-libs v0.43.1 (#7054),LoadTLSServerConfigalready handlesCertReloaderwiring automatically — correctly skipping it when inline PEMs are used and applying it only for file-path certificates.BuildServerConfig()then setsGetCertificateon the resultingtls.Config.No behavioral change for file-path cert configurations: hot-reload continues to work exactly as before, as validated by
Test_server_TLSCertReload.How to test this PR locally
The existing integration test validates end-to-end cert reload:
Design Checklist
Checklist
Related issues
🤖 Generated with Claude Code