Skip to content

Commit e748488

Browse files
authored
Upgrade elasticsearch-ruby client. (#17161)
* Upgrade elasticsearch-ruby client. * Fix Faraday removed basic auth option and apply the ES client module name change.
1 parent d916972 commit e748488

File tree

8 files changed

+12
-13
lines changed

8 files changed

+12
-13
lines changed

Gemfile.template

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ gem "ruby-maven-libs", "~> 3", ">= 3.9.6.1"
1313
gem "logstash-output-elasticsearch", ">= 11.14.0"
1414
gem "polyglot", require: false
1515
gem "treetop", require: false
16-
gem "faraday", "~> 1", :require => false # due elasticsearch-transport (elastic-transport) depending faraday '~> 1'
1716
gem "minitar", "~> 1", :group => :build
1817
gem "childprocess", "~> 4", :group => :build
1918
gem "fpm", "~> 1", ">= 1.14.1", :group => :build # compound due to bugfix https://github.com/jordansissel/fpm/pull/1856

logstash-core/logstash-core.gemspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Gem::Specification.new do |gem|
3939
gem.email = ["[email protected]"]
4040
gem.description = %q{The core components of logstash, the scalable log and event management tool}
4141
gem.summary = %q{logstash-core - The core components of logstash}
42-
gem.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
42+
gem.homepage = "https://www.elastic.co/logstash"
4343
gem.license = "Apache-2.0"
4444

4545
gem.files = Dir.glob(
@@ -78,7 +78,7 @@ Gem::Specification.new do |gem|
7878

7979
gem.add_runtime_dependency "jrjackson", "= #{ALL_VERSIONS.fetch('jrjackson')}" #(Apache 2.0 license)
8080

81-
gem.add_runtime_dependency "elasticsearch", '~> 7'
81+
gem.add_runtime_dependency "elasticsearch", '~> 8'
8282
gem.add_runtime_dependency "manticore", '~> 0.6'
8383

8484
# xpack geoip database service

logstash-core/spec/logstash/webserver_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def free_ports(servers)
191191
context "and invalid basic auth is provided" do
192192
it 'emits an HTTP 401 with WWW-Authenticate header' do
193193
response = Faraday.new("http://#{api_host}:#{webserver.port}") do |conn|
194-
conn.request :basic_auth, 'john-doe', 'open-sesame'
194+
conn.request :authorization, :basic, 'john-doe', 'open-sesame'
195195
end.get('/')
196196
aggregate_failures do
197197
expect(response.status).to eq(401)
@@ -202,7 +202,7 @@ def free_ports(servers)
202202
context "and valid auth is provided" do
203203
it "returns a relevant response" do
204204
response = Faraday.new("http://#{api_host}:#{webserver.port}") do |conn|
205-
conn.request :basic_auth, 'a-user', 's3cur3dPas!'
205+
conn.request :authorization, :basic, 'a-user', 's3cur3dPas!'
206206
end.get('/')
207207
aggregate_failures do
208208
expect(response.status).to eq(200)

qa/integration/specs/dlq_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@
8383
try(60) do
8484
begin
8585
result = es_client.search(index: 'test-index', size: 0, q: '*')
86-
rescue Elasticsearch::Transport::Transport::Errors::ServiceUnavailable => e
86+
rescue Elastic::Transport::Transport::Errors::ServiceUnavailable => e
8787
puts "Elasticsearch unavailable #{e.inspect}"
8888
hits = 0
89-
rescue Elasticsearch::Transport::Transport::Errors::NotFound => e
89+
rescue Elastic::Transport::Transport::Errors::NotFound => e
9090
puts "Index not found"
9191
hits = 0
9292
end

x-pack/qa/integration/management/multiple_pipelines_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def count_hashes(pipelines)
138138

139139
begin
140140
res = elasticsearch_client.search(index: '.monitoring-logstash-*', body: query)
141-
rescue Elasticsearch::Transport::Transport::Errors::ServiceUnavailable
141+
rescue Elastic::Transport::Transport::Errors::ServiceUnavailable
142142
return nil
143143
end
144144

x-pack/qa/integration/monitoring/es_documents_structure_validation_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
let(:retryable_errors) do
2020
[NoMethodError,
2121
RSpec::Expectations::ExpectationNotMetError,
22-
Elasticsearch::Transport::Transport::Errors::ServiceUnavailable,
23-
Elasticsearch::Transport::Transport::Errors::NotFound]
22+
Elastic::Transport::Transport::Errors::ServiceUnavailable,
23+
Elastic::Transport::Transport::Errors::NotFound]
2424
end
2525

2626
describe "metrics" do

x-pack/qa/integration/support/helpers.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def cleanup_system_indices(pipeline_ids)
124124
pipeline_ids.each do |id|
125125
begin
126126
elasticsearch_client.perform_request(:delete, "_logstash/pipeline/#{id}")
127-
rescue Elasticsearch::Transport::Transport::Errors::NotFound => e
127+
rescue Elastic::Transport::Transport::Errors::NotFound => e
128128
puts ".logstash can be empty #{e.message}"
129129
end
130130
end

x-pack/qa/integration/support/shared_examples.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
let(:retryable_errors) do
1010
[NoMethodError,
1111
RSpec::Expectations::ExpectationNotMetError,
12-
Elasticsearch::Transport::Transport::Errors::ServiceUnavailable,
13-
Elasticsearch::Transport::Transport::Errors::NotFound]
12+
Elastic::Transport::Transport::Errors::ServiceUnavailable,
13+
Elastic::Transport::Transport::Errors::NotFound]
1414
end
1515

1616
describe "metrics" do

0 commit comments

Comments
 (0)