Skip to content
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

Fix spurious admin dashboard warning when using ElasticSearch 7.x #23064

Merged
merged 1 commit into from
Jan 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions app/lib/admin/system_check/elasticsearch_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,24 @@ def message

def running_version
@running_version ||= begin
Chewy.client.info['version']['minimum_wire_compatibility_version'] ||
Chewy.client.info['version']['number']
Chewy.client.info['version']['number']
rescue Faraday::ConnectionFailed
nil
end
end

def compatible_wire_version
Chewy.client.info['version']['minimum_wire_compatibility_version']
end

def required_version
'7.x'
end

def compatible_version?
return false if running_version.nil?
Gem::Version.new(running_version) >= Gem::Version.new(required_version)

Gem::Version.new(running_version) >= Gem::Version.new(required_version) ||
Gem::Version.new(compatible_wire_version) >= Gem::Version.new(required_version)
end
end