From 60540c2417070b444b6886147d2dbd9f641f144a Mon Sep 17 00:00:00 2001 From: Frank Schroeder Date: Tue, 18 Jul 2017 20:50:37 +0200 Subject: [PATCH] agent: stop and remove docker checks Note that there is no test since the correct way to solve (and test) this is to replace the different maps with a single one or to hide that functionality behind a separate data structure. This will be addressed in #3294. Fixes #3265 --- agent/agent.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/agent/agent.go b/agent/agent.go index 4650d0c6a9..e2e93d0844 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -1826,6 +1826,10 @@ func (a *Agent) RemoveCheck(checkID types.CheckID, persist bool) error { check.Stop() delete(a.checkTTLs, checkID) } + if check, ok := a.checkDockers[checkID]; ok { + check.Stop() + delete(a.checkDockers, checkID) + } if persist { if err := a.purgeCheck(checkID); err != nil { return err