-
Notifications
You must be signed in to change notification settings - Fork 726
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
Create Elasticsearch client for observer only if needed #6407
Create Elasticsearch client for observer only if needed #6407
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
1 similar comment
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
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.
Changes look good. Minor comment changes requested.
defer tracing.Span(&ctx)() | ||
nsName := k8s.ExtractNamespacedName(&cluster) | ||
settings := m.extractObserverSettings(ctx, cluster) | ||
|
||
observer, exists := m.getObserver(nsName) | ||
|
||
var esClient client.Client | ||
if exists { | ||
esClient = esClientProvider(observer.esClient) |
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.
We are effectively doing the comparison twice now here and on L88. Not sure if it worth optimising this further Equals
is pretty fast.
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.
I think for readability it is better to carry out the comparison twice.
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
Co-authored-by: Peter Brachwitz <peter.brachwitz@gmail.com>
buildkite test this |
@elasticmachine run elasticsearch-ci/docs |
This PR implements the functionality to create a new ES client for the observer only if needed, i.e. if there are changes in the client config.
It fixes #6090