Skip to content

Commit df417f7

Browse files
committed
docs: note why check.Expose is not part of chech.Hash
1 parent e63f13a commit df417f7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

nomad/structs/services.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ func (sc *ServiceCheck) Hash(serviceID string) string {
290290
hashString(h, sc.Path)
291291
hashString(h, sc.Protocol)
292292
hashString(h, sc.PortLabel)
293-
hashBool(h, sc.Expose, "Expose")
294293
hashString(h, sc.Interval.String())
295294
hashString(h, sc.Timeout.String())
296295
hashString(h, sc.Method)
@@ -310,6 +309,11 @@ func (sc *ServiceCheck) Hash(serviceID string) string {
310309
// use name "true" to maintain ID stability
311310
hashBool(h, sc.GRPCUseTLS, "true")
312311

312+
// Hash is used for diffing against the Consul check definition, which does
313+
// not have an expose parameter. Instead we rely on implied changes to
314+
// other fields if the Expose setting is changed in a nomad service.
315+
// hashBool(h, sc.Expose, "Expose")
316+
313317
// maintain use of hex (i.e. not b32) to maintain ID stability
314318
return fmt.Sprintf("%x", h.Sum(nil))
315319
}

0 commit comments

Comments
 (0)