Skip to content

make credentail and host setup happen in build_client #939

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

Merged
merged 2 commits into from
Apr 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 10.4.2
- Changed cloud id, credential and host setup to happen in `build_client` [#939](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/939)

## 10.4.1
- [DOC] Added note about `_type` setting change from `doc` to `_doc` [#884](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/884)

Expand Down
4 changes: 4 additions & 0 deletions lib/logstash/outputs/elasticsearch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ def config_init(params)
end

def build_client
fill_user_password_from_cloud_auth
fill_hosts_from_cloud_id
setup_hosts

params["metric"] = metric
if @proxy.eql?('')
@logger.warn "Supplied proxy setting (proxy => '') has no effect"
Expand Down
3 changes: 0 additions & 3 deletions lib/logstash/outputs/elasticsearch/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ def register
# To support BWC, we check if DLQ exists in core (< 5.4). If it doesn't, we use nil to resort to previous behavior.
@dlq_writer = dlq_enabled? ? execution_context.dlq_writer : nil

fill_hosts_from_cloud_id
fill_user_password_from_cloud_auth
setup_hosts # properly sets @hosts
build_client
setup_after_successful_connection
check_action_validity
Expand Down
2 changes: 1 addition & 1 deletion logstash-output-elasticsearch.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'logstash-output-elasticsearch'
s.version = '10.4.1'
s.version = '10.4.2'

s.licenses = ['apache-2.0']
s.summary = "Stores logs in Elasticsearch"
Expand Down