docker: stop previous check on replace

This commit is contained in:
Frank Schroeder 2017-10-26 12:03:07 +02:00
parent bf98779d84
commit 7d05e55734
No known key found for this signature in database
GPG key ID: 4D65C6EAEC87DECD

View file

@ -1776,6 +1776,9 @@ func (a *Agent) AddCheck(check *structs.HealthCheck, chkType *structs.CheckType,
Logger: a.logger,
Client: a.dockerClient,
}
if prev := a.checkDockers[check.CheckID]; prev != nil {
prev.Stop()
}
dockerCheck.Start()
a.checkDockers[check.CheckID] = dockerCheck