Using the service id in check hash
This commit is contained in:
parent
b35819f10a
commit
f66069a08d
|
@ -270,7 +270,7 @@ func (c *ConsulService) makeChecks(service *structs.Service, ip string, port int
|
|||
check.Name = fmt.Sprintf("service: '%s' check", service.Name)
|
||||
}
|
||||
cr := &consul.AgentCheckRegistration{
|
||||
ID: check.Hash(),
|
||||
ID: check.Hash(service.Id),
|
||||
Name: check.Name,
|
||||
ServiceID: service.Id,
|
||||
}
|
||||
|
|
|
@ -1040,8 +1040,9 @@ func (sc *ServiceCheck) Validate() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (sc *ServiceCheck) Hash() string {
|
||||
func (sc *ServiceCheck) Hash(serviceId string) string {
|
||||
h := sha1.New()
|
||||
io.WriteString(h, serviceId)
|
||||
io.WriteString(h, sc.Name)
|
||||
io.WriteString(h, sc.Type)
|
||||
io.WriteString(h, sc.Script)
|
||||
|
|
Loading…
Reference in New Issue