From 52e73301f6c29c1bb350419469bd41ff1eadfedb Mon Sep 17 00:00:00 2001 From: Frank Schroeder Date: Fri, 20 Oct 2017 06:41:12 +0200 Subject: [PATCH] local state: clone check to avoid side effect --- agent/local/state.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/agent/local/state.go b/agent/local/state.go index 8007505167..b0adcd53d7 100644 --- a/agent/local/state.go +++ b/agent/local/state.go @@ -335,6 +335,9 @@ func (l *State) AddCheck(check *structs.HealthCheck, token string) error { return fmt.Errorf("no check") } + // clone the check since we will be modifying it. + check = check.Clone() + if l.discardCheckOutput.Load().(bool) { check.Output = "" }