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

Make conpatible for Fluentd v1.8 #677

Merged
merged 1 commit into from
Dec 4, 2019
Merged
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
14 changes: 11 additions & 3 deletions lib/fluent/plugin/out_elasticsearch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def configure(conf)
end

@alias_indexes = []
if !Fluent::Engine.dry_run_mode
if !dry_run?
if @template_name && @template_file
if @rollover_index
raise Fluent::ConfigError, "'deflector_alias' must be provided if 'rollover_index' is set true ." if not @deflector_alias
Expand Down Expand Up @@ -257,7 +257,7 @@ def configure(conf)
end

@last_seen_major_version =
if @verify_es_version_at_startup && !Fluent::Engine.dry_run_mode
if @verify_es_version_at_startup && !dry_run?
retry_operate(@max_retry_get_es_version) do
detect_es_major_version
end
Expand All @@ -276,7 +276,7 @@ def configure(conf)
@type_name = nil
end

if @validate_client_version && !Fluent::Engine.dry_run_mode
if @validate_client_version && !dry_run?
if @last_seen_major_version != client_library_version.to_i
raise Fluent::ConfigError, <<-EOC
Detected ES #{@last_seen_major_version} but you use ES client #{client_library_version}.
Expand Down Expand Up @@ -329,6 +329,14 @@ class << self
end
end

def dry_run?
if Fluent::Engine.respond_to?(:dry_run_mode)
Fluent::Engine.dry_run_mode
elsif Fluent::Engine.respond_to?(:supervisor_mode)
Fluent::Engine.supervisor_mode
end
end

def placeholder?(name, param)
begin
placeholder_validate!(name, param)
Expand Down