Skip to content

Commit

Permalink
docs: note why check.Expose is not part of chech.Hash
Browse files Browse the repository at this point in the history
  • Loading branch information
shoenig committed Mar 31, 2020
1 parent e63f13a commit df417f7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nomad/structs/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ func (sc *ServiceCheck) Hash(serviceID string) string {
hashString(h, sc.Path)
hashString(h, sc.Protocol)
hashString(h, sc.PortLabel)
hashBool(h, sc.Expose, "Expose")
hashString(h, sc.Interval.String())
hashString(h, sc.Timeout.String())
hashString(h, sc.Method)
Expand All @@ -310,6 +309,11 @@ func (sc *ServiceCheck) Hash(serviceID string) string {
// use name "true" to maintain ID stability
hashBool(h, sc.GRPCUseTLS, "true")

// Hash is used for diffing against the Consul check definition, which does
// not have an expose parameter. Instead we rely on implied changes to
// other fields if the Expose setting is changed in a nomad service.
// hashBool(h, sc.Expose, "Expose")

// maintain use of hex (i.e. not b32) to maintain ID stability
return fmt.Sprintf("%x", h.Sum(nil))
}
Expand Down

0 comments on commit df417f7

Please sign in to comment.