mirror of
https://github.com/status-im/consul.git
synced 2025-01-11 06:16:08 +00:00
local state: clone check to avoid side effect
This commit is contained in:
parent
6bc9d66192
commit
52e73301f6
@ -335,6 +335,9 @@ func (l *State) AddCheck(check *structs.HealthCheck, token string) error {
|
|||||||
return fmt.Errorf("no check")
|
return fmt.Errorf("no check")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clone the check since we will be modifying it.
|
||||||
|
check = check.Clone()
|
||||||
|
|
||||||
if l.discardCheckOutput.Load().(bool) {
|
if l.discardCheckOutput.Load().(bool) {
|
||||||
check.Output = ""
|
check.Output = ""
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user