From 39a2d8d25e629823e183e384e8414171edcf4164 Mon Sep 17 00:00:00 2001 From: Frank Schroeder Date: Fri, 20 Oct 2017 06:24:32 +0200 Subject: [PATCH] local state: use synchronized access to internal maps --- agent/local/state.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/local/state.go b/agent/local/state.go index 69e136816a..8007505167 100644 --- a/agent/local/state.go +++ b/agent/local/state.go @@ -341,7 +341,7 @@ func (l *State) AddCheck(check *structs.HealthCheck, token string) error { // if there is a serviceID associated with the check, make sure it exists before adding it // NOTE - This logic may be moved to be handled within the Agent's Addcheck method after a refactor - if check.ServiceID != "" && l.services[check.ServiceID] == nil { + if check.ServiceID != "" && l.Service(check.ServiceID) == nil { return fmt.Errorf("Check %q refers to non-existent service %q", check.CheckID, check.ServiceID) }