Skip to content

Commit 1b8fa10

Browse files
committed
make cred and host setup happens in build_client
1 parent df32e53 commit 1b8fa10

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/logstash/outputs/elasticsearch.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@ def config_init(params)
255255
end
256256

257257
def build_client
258+
fill_user_password_from_cloud_auth
259+
fill_hosts_from_cloud_id
260+
setup_hosts
261+
258262
params["metric"] = metric
259263
if @proxy.eql?('')
260264
@logger.warn "Supplied proxy setting (proxy => '') has no effect"

lib/logstash/outputs/elasticsearch/common.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ def register
2121
# To support BWC, we check if DLQ exists in core (< 5.4). If it doesn't, we use nil to resort to previous behavior.
2222
@dlq_writer = dlq_enabled? ? execution_context.dlq_writer : nil
2323

24-
fill_hosts_from_cloud_id
25-
fill_user_password_from_cloud_auth
26-
setup_hosts # properly sets @hosts
2724
build_client
2825
setup_after_successful_connection
2926
check_action_validity

0 commit comments

Comments
 (0)