Using a helper method to create service identifiers

This commit is contained in:
Diptanu Choudhury
2016-05-14 00:43:25 -07:00
parent 8c5aa0fe65
commit 522eebcbc1
4 changed files with 14 additions and 10 deletions

View File

@@ -436,7 +436,7 @@ func (e *UniversalExecutor) SyncServices(ctx *ConsulContext) error {
return err
}
cs.SetDelegatedChecks(e.createCheckMap(), e.createCheck)
cs.SetServiceIdentifier(fmt.Sprintf("%s-%s", e.ctx.AllocID, e.ctx.Task.Name))
cs.SetServiceIdentifier(consul.GenerateServiceIdentifier(e.ctx.AllocID, e.ctx.Task.Name))
cs.SetAddrFinder(e.ctx.Task.FindHostAndPortFor)
e.consulService = cs
}