Skip to content

Commit

Permalink
service_disovery_create_manager is better
Browse files Browse the repository at this point in the history
Signed-off-by: Yuta Iwama <ganmacs@gmail.com>
  • Loading branch information
ganmacs committed Aug 8, 2019
1 parent 54e8d53 commit 46e6e0c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/fluent/plugin/out_forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def configure(conf)
configs << { type: @service_discovery[i][:@type], conf: c }
end

create_service_discovery_manager(
service_disovery_create_manager(
:out_forward_service_discovery_watcher,
configurations: configs,
load_balancer: LoadBalancer.new(log),
Expand Down
2 changes: 1 addition & 1 deletion lib/fluent/plugin_helper/service_discovery.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def start
# @param configurations [Hash] hash which must has discivery_service type and its configuration like `{ type: :static, conf: <Fluent::Config::Element> }`
# @param load_balancer [Object] object which has two methods #rebalance and #select_service
# @param custom_build_method [Proc]
def create_service_discovery_manager(title, configurations:, load_balancer: nil, custom_build_method: nil, interval: 3)
def service_disovery_create_manager(title, configurations:, load_balancer: nil, custom_build_method: nil, interval: 3)
@_plugin_helper_service_discovery_title = title
@_plugin_helper_service_discovery_iterval = interval

Expand Down
6 changes: 3 additions & 3 deletions test/plugin_helper/test_service_discovery.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Dummy < Fluent::Plugin::TestBase
helpers :service_discovery

# Make these mehtod public
def create_service_discovery_manager(title, configurations:, load_balancer: nil, custom_build_method: nil, interval: 3)
def service_disovery_create_manager(title, configurations:, load_balancer: nil, custom_build_method: nil, interval: 3)
super
end

Expand All @@ -38,7 +38,7 @@ def discovery_manager
test 'start discovery manager' do
d = @d = Dummy.new

d.create_service_discovery_manager(
d.service_disovery_create_manager(
:service_discovery_helper_test,
configurations: [{ type: :static, conf: config_element('root', '', {}, [config_element('service', '', { 'host' => '127.0.0.1', 'port' => '1234' })]) }],
)
Expand All @@ -59,7 +59,7 @@ def discovery_manager
test 'call timer_execute if dynamic configuration' do
d = @d = Dummy.new

d.create_service_discovery_manager(
d.service_disovery_create_manager(
:service_discovery_helper_test,
configurations: [{ type: :file, conf: config_element('file_config', '', { 'path' => File.join(@sd_file_dir, 'config.yml') }) }],
)
Expand Down

0 comments on commit 46e6e0c

Please sign in to comment.