Merge default values with custom API Key Elasticsearch settings#3342
Merged
simitt merged 3 commits intoelastic:masterfrom Feb 18, 2020
Merged
Merge default values with custom API Key Elasticsearch settings#3342simitt merged 3 commits intoelastic:masterfrom
simitt merged 3 commits intoelastic:masterfrom
Conversation
When configuring an Elasticsearch instance for API Key usage, Elasticsearch default values should be merged with the custom config, to avoid having to configure all settings. fixes elastic#3341
jalvz
approved these changes
Feb 17, 2020
simitt
added a commit
to simitt/apm-server
that referenced
this pull request
Feb 18, 2020
…tic#3342) When configuring an Elasticsearch instance for API Key usage, Elasticsearch default values should be merged with the custom config, to avoid having to configure all settings. fixes elastic#3341
simitt
added a commit
to simitt/apm-server
that referenced
this pull request
Feb 18, 2020
…tic#3342) When configuring an Elasticsearch instance for API Key usage, Elasticsearch default values should be merged with the custom config, to avoid having to configure all settings. fixes elastic#3341
simitt
added a commit
that referenced
this pull request
Feb 21, 2020
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.
Motivation/summary
When configuring an Elasticsearch instance for API Key usage, Elasticsearch default values should be merged with the custom configuration.
At the moment default values are not merged as soon as any of the
apm-server.api_key.elasticsearch.*options is configured, which is unexpected behavior and not aligned with how other configuration options are merged with default values.This PR changes the behavior to use default options where no dedicated configuration option is provided. This change also allows to add the
requiredflag for the Elasticsearchhostoption again, as now the host is always set by default.Checklist
- [ ] I have signed the Contributor License Agreement.make check-fullfor static code checks and linting)- [ ] I have made corresponding changes to the documentationHow to test these changes
Configure some option of
apm-server.api_key.elasticsearch.*and ensure default values are applied for missing configuration options.Default values are
hosts: []string{"localhost:9200"}, protocol: "http", timeout: 5s.E.g. ensure to have a locally running Elasticsearch instance with security enabled and run
./apm-server apikey create -e -E apm-server.api_key.enabled=true -E apm-server.api_key.elasticsearch.username=foo -E apm-server.api_key.elasticsearch.password=barWhen providing proper username+password this should create an API Key, by using the default
hostconfiguration oflocalhost:9200.Related issues
fixes #3341