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
This commit is contained in:
Frank Schroeder 2017-07-18 20:50:37 +02:00 committed by Frank Schröder
parent 1bc0acf437
commit c8ae94b688
1 changed files with 4 additions and 0 deletions

View File

@ -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