Skip to content
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

Fix EnterpriseSearch upgrade with TLS disabled #6224

Merged
merged 2 commits into from
Dec 20, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions pkg/controller/enterprisesearch/version_upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,13 @@ func (r *VersionUpgrade) setReadOnlyMode(ctx context.Context, enabled bool) erro
httpClient := r.httpClient
if httpClient == nil {
// build an HTTP client to reach the Enterprise Search service
tlsCerts, err := r.retrieveTLSCerts()
if err != nil {
return err
var tlsCerts []*x509.Certificate
if r.ent.Spec.HTTP.TLS.Enabled() {
var err error
tlsCerts, err = r.retrieveTLSCerts()
if err != nil {
return err
}
}
httpClient = apmhttp.WrapClient(
commonhttp.Client(r.dialer, tlsCerts, 0),
Expand Down