Skip to content

Commit

Permalink
Use id (if present) in the service def file path
Browse files Browse the repository at this point in the history
It allow us to register a service multiple times with different
ports (for a service that exposes multiple ports). Pass unique service
id when registering a service.
  • Loading branch information
what do you want? committed Oct 27, 2014
1 parent 3f76738 commit 9c8dad7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion resources/service_def.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def self.validate_check(check)
end

def path
::File.join(node['consul']['config_dir'], "service-#{name}.json")
# Use id (if present) instead of name since it is unique
::File.join(node['consul']['config_dir'], "service-#{id || name}.json")
end

def to_json
Expand Down

0 comments on commit 9c8dad7

Please sign in to comment.