Skip to content

Upgrade elasticsearch-ruby client. #17161

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
Mar 13, 2025
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
1 change: 0 additions & 1 deletion Gemfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ gem "ruby-maven-libs", "~> 3", ">= 3.9.6.1"
gem "logstash-output-elasticsearch", ">= 11.14.0"
gem "polyglot", require: false
gem "treetop", require: false
gem "faraday", "~> 1", :require => false # due elasticsearch-transport (elastic-transport) depending faraday '~> 1'
gem "minitar", "~> 1", :group => :build
gem "childprocess", "~> 4", :group => :build
gem "fpm", "~> 1", ">= 1.14.1", :group => :build # compound due to bugfix https://github.com/jordansissel/fpm/pull/1856
Expand Down
4 changes: 2 additions & 2 deletions logstash-core/logstash-core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |gem|
gem.email = ["info@elastic.co"]
gem.description = %q{The core components of logstash, the scalable log and event management tool}
gem.summary = %q{logstash-core - The core components of logstash}
gem.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
gem.homepage = "https://www.elastic.co/logstash"
gem.license = "Apache-2.0"

gem.files = Dir.glob(
Expand Down Expand Up @@ -78,7 +78,7 @@ Gem::Specification.new do |gem|

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

gem.add_runtime_dependency "elasticsearch", '~> 7'
gem.add_runtime_dependency "elasticsearch", '~> 8'
gem.add_runtime_dependency "manticore", '~> 0.6'

# xpack geoip database service
Expand Down
4 changes: 2 additions & 2 deletions logstash-core/spec/logstash/webserver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def free_ports(servers)
context "and invalid basic auth is provided" do
it 'emits an HTTP 401 with WWW-Authenticate header' do
response = Faraday.new("http://#{api_host}:#{webserver.port}") do |conn|
conn.request :basic_auth, 'john-doe', 'open-sesame'
conn.request :authorization, :basic, 'john-doe', 'open-sesame'
end.get('/')
aggregate_failures do
expect(response.status).to eq(401)
Expand All @@ -202,7 +202,7 @@ def free_ports(servers)
context "and valid auth is provided" do
it "returns a relevant response" do
response = Faraday.new("http://#{api_host}:#{webserver.port}") do |conn|
conn.request :basic_auth, 'a-user', 's3cur3dPas!'
conn.request :authorization, :basic, 'a-user', 's3cur3dPas!'
end.get('/')
aggregate_failures do
expect(response.status).to eq(200)
Expand Down
4 changes: 2 additions & 2 deletions qa/integration/specs/dlq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@
try(60) do
begin
result = es_client.search(index: 'test-index', size: 0, q: '*')
rescue Elasticsearch::Transport::Transport::Errors::ServiceUnavailable => e
rescue Elastic::Transport::Transport::Errors::ServiceUnavailable => e
puts "Elasticsearch unavailable #{e.inspect}"
hits = 0
rescue Elasticsearch::Transport::Transport::Errors::NotFound => e
rescue Elastic::Transport::Transport::Errors::NotFound => e
puts "Index not found"
hits = 0
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def count_hashes(pipelines)

begin
res = elasticsearch_client.search(index: '.monitoring-logstash-*', body: query)
rescue Elasticsearch::Transport::Transport::Errors::ServiceUnavailable
rescue Elastic::Transport::Transport::Errors::ServiceUnavailable
return nil
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
let(:retryable_errors) do
[NoMethodError,
RSpec::Expectations::ExpectationNotMetError,
Elasticsearch::Transport::Transport::Errors::ServiceUnavailable,
Elasticsearch::Transport::Transport::Errors::NotFound]
Elastic::Transport::Transport::Errors::ServiceUnavailable,
Elastic::Transport::Transport::Errors::NotFound]
end

describe "metrics" do
Expand Down
2 changes: 1 addition & 1 deletion x-pack/qa/integration/support/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def cleanup_system_indices(pipeline_ids)
pipeline_ids.each do |id|
begin
elasticsearch_client.perform_request(:delete, "_logstash/pipeline/#{id}")
rescue Elasticsearch::Transport::Transport::Errors::NotFound => e
rescue Elastic::Transport::Transport::Errors::NotFound => e
puts ".logstash can be empty #{e.message}"
end
end
Expand Down
4 changes: 2 additions & 2 deletions x-pack/qa/integration/support/shared_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
let(:retryable_errors) do
[NoMethodError,
RSpec::Expectations::ExpectationNotMetError,
Elasticsearch::Transport::Transport::Errors::ServiceUnavailable,
Elasticsearch::Transport::Transport::Errors::NotFound]
Elastic::Transport::Transport::Errors::ServiceUnavailable,
Elastic::Transport::Transport::Errors::NotFound]
end

describe "metrics" do
Expand Down