Skip to content

Commit

Permalink
Make conpatible for Fluentd v1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmo0920 committed Dec 3, 2019
1 parent 6c3533e commit fc15153
Showing 1 changed file with 11 additions and 3 deletions.
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

0 comments on commit fc15153

Please sign in to comment.