mirror of
https://github.com/elastic/logstash.git
synced 2025-04-19 04:15:23 -04:00
Upgrade elasticsearch-ruby client. (#17161)
* Upgrade elasticsearch-ruby client. * Fix Faraday removed basic auth option and apply the ES client module name change.
This commit is contained in:
parent
d916972877
commit
e748488e4a
8 changed files with 12 additions and 13 deletions
|
@ -13,7 +13,6 @@ gem "ruby-maven-libs", "~> 3", ">= 3.9.6.1"
|
||||||
gem "logstash-output-elasticsearch", ">= 11.14.0"
|
gem "logstash-output-elasticsearch", ">= 11.14.0"
|
||||||
gem "polyglot", require: false
|
gem "polyglot", require: false
|
||||||
gem "treetop", 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 "minitar", "~> 1", :group => :build
|
||||||
gem "childprocess", "~> 4", :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
|
gem "fpm", "~> 1", ">= 1.14.1", :group => :build # compound due to bugfix https://github.com/jordansissel/fpm/pull/1856
|
||||||
|
|
|
@ -39,7 +39,7 @@ Gem::Specification.new do |gem|
|
||||||
gem.email = ["info@elastic.co"]
|
gem.email = ["info@elastic.co"]
|
||||||
gem.description = %q{The core components of logstash, the scalable log and event management tool}
|
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.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.license = "Apache-2.0"
|
||||||
|
|
||||||
gem.files = Dir.glob(
|
gem.files = Dir.glob(
|
||||||
|
@ -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 "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'
|
gem.add_runtime_dependency "manticore", '~> 0.6'
|
||||||
|
|
||||||
# xpack geoip database service
|
# xpack geoip database service
|
||||||
|
|
|
@ -191,7 +191,7 @@ describe LogStash::WebServer do
|
||||||
context "and invalid basic auth is provided" do
|
context "and invalid basic auth is provided" do
|
||||||
it 'emits an HTTP 401 with WWW-Authenticate header' do
|
it 'emits an HTTP 401 with WWW-Authenticate header' do
|
||||||
response = Faraday.new("http://#{api_host}:#{webserver.port}") do |conn|
|
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('/')
|
end.get('/')
|
||||||
aggregate_failures do
|
aggregate_failures do
|
||||||
expect(response.status).to eq(401)
|
expect(response.status).to eq(401)
|
||||||
|
@ -202,7 +202,7 @@ describe LogStash::WebServer do
|
||||||
context "and valid auth is provided" do
|
context "and valid auth is provided" do
|
||||||
it "returns a relevant response" do
|
it "returns a relevant response" do
|
||||||
response = Faraday.new("http://#{api_host}:#{webserver.port}") do |conn|
|
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('/')
|
end.get('/')
|
||||||
aggregate_failures do
|
aggregate_failures do
|
||||||
expect(response.status).to eq(200)
|
expect(response.status).to eq(200)
|
||||||
|
|
|
@ -83,10 +83,10 @@ describe "Test Dead Letter Queue" do
|
||||||
try(60) do
|
try(60) do
|
||||||
begin
|
begin
|
||||||
result = es_client.search(index: 'test-index', size: 0, q: '*')
|
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}"
|
puts "Elasticsearch unavailable #{e.inspect}"
|
||||||
hits = 0
|
hits = 0
|
||||||
rescue Elasticsearch::Transport::Transport::Errors::NotFound => e
|
rescue Elastic::Transport::Transport::Errors::NotFound => e
|
||||||
puts "Index not found"
|
puts "Index not found"
|
||||||
hits = 0
|
hits = 0
|
||||||
end
|
end
|
||||||
|
|
|
@ -138,7 +138,7 @@ describe "Read configuration from elasticsearch" do
|
||||||
|
|
||||||
begin
|
begin
|
||||||
res = elasticsearch_client.search(index: '.monitoring-logstash-*', body: query)
|
res = elasticsearch_client.search(index: '.monitoring-logstash-*', body: query)
|
||||||
rescue Elasticsearch::Transport::Transport::Errors::ServiceUnavailable
|
rescue Elastic::Transport::Transport::Errors::ServiceUnavailable
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@ describe "Monitoring internal collector documents" do
|
||||||
let(:retryable_errors) do
|
let(:retryable_errors) do
|
||||||
[NoMethodError,
|
[NoMethodError,
|
||||||
RSpec::Expectations::ExpectationNotMetError,
|
RSpec::Expectations::ExpectationNotMetError,
|
||||||
Elasticsearch::Transport::Transport::Errors::ServiceUnavailable,
|
Elastic::Transport::Transport::Errors::ServiceUnavailable,
|
||||||
Elasticsearch::Transport::Transport::Errors::NotFound]
|
Elastic::Transport::Transport::Errors::NotFound]
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "metrics" do
|
describe "metrics" do
|
||||||
|
|
|
@ -124,7 +124,7 @@ def cleanup_system_indices(pipeline_ids)
|
||||||
pipeline_ids.each do |id|
|
pipeline_ids.each do |id|
|
||||||
begin
|
begin
|
||||||
elasticsearch_client.perform_request(:delete, "_logstash/pipeline/#{id}")
|
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}"
|
puts ".logstash can be empty #{e.message}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,8 +9,8 @@ shared_examples "record monitoring data to es" do
|
||||||
let(:retryable_errors) do
|
let(:retryable_errors) do
|
||||||
[NoMethodError,
|
[NoMethodError,
|
||||||
RSpec::Expectations::ExpectationNotMetError,
|
RSpec::Expectations::ExpectationNotMetError,
|
||||||
Elasticsearch::Transport::Transport::Errors::ServiceUnavailable,
|
Elastic::Transport::Transport::Errors::ServiceUnavailable,
|
||||||
Elasticsearch::Transport::Transport::Errors::NotFound]
|
Elastic::Transport::Transport::Errors::NotFound]
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "metrics" do
|
describe "metrics" do
|
||||||
|
|
Loading…
Add table
Reference in a new issue