Skip to content

Commit

Permalink
Merge pull request #677 from uken/fluentd-1.8-compatibile
Browse files Browse the repository at this point in the history
Make conpatible for Fluentd v1.8
  • Loading branch information
cosmo0920 authored Dec 4, 2019
2 parents 6a490bb + fc15153 commit 3a64c3f
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 @@ -206,7 +206,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 @@ -259,7 +259,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 @@ -278,7 +278,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 @@ -343,6 +343,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 3a64c3f

Please sign in to comment.