From df417f71009361a7b0dc812ddaa92e843d1e238f Mon Sep 17 00:00:00 2001 From: Seth Hoenig Date: Tue, 31 Mar 2020 12:42:01 -0600 Subject: [PATCH] docs: note why check.Expose is not part of chech.Hash --- nomad/structs/services.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nomad/structs/services.go b/nomad/structs/services.go index 04a34d0e450..ee8b12b3b82 100644 --- a/nomad/structs/services.go +++ b/nomad/structs/services.go @@ -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) @@ -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)) }