Skip to content

Commit

Permalink
Merge pull request #479 from hashicorp/r-consul-check
Browse files Browse the repository at this point in the history
Using the service name in the service id so that it's unique
  • Loading branch information
diptanu committed Nov 20, 2015
2 parents 277ce3c + 6592483 commit b0fe212
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/consul.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (c *ConsulClient) SyncWithConsul() {

func (c *ConsulClient) registerService(service *structs.Service, task *structs.Task, allocID string) error {
var mErr multierror.Error
service.Id = fmt.Sprintf("%s-%s", allocID, task.Name)
service.Id = fmt.Sprintf("%s-%s", allocID, service.Name)
host, port := c.findPortAndHostForLabel(service.PortLabel, task)
if host == "" || port == 0 {
return fmt.Errorf("consul: The port:%s marked for registration of service: %s couldn't be found", service.PortLabel, service.Name)
Expand Down

0 comments on commit b0fe212

Please sign in to comment.