mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
Using the service id in check hash
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user