Adds script warning and fixes Docker args recognition.
This commit is contained in:
parent
b61ec82b2f
commit
97b580f593
|
@ -1697,6 +1697,11 @@ func (a *Agent) AddCheck(check *structs.HealthCheck, chkType *structs.CheckType,
|
||||||
check.CheckID, MinInterval))
|
check.CheckID, MinInterval))
|
||||||
chkType.Interval = MinInterval
|
chkType.Interval = MinInterval
|
||||||
}
|
}
|
||||||
|
if chkType.Script != "" {
|
||||||
|
a.logger.Printf("[WARN] agent: check %q has the 'script' field, which has been deprecated "+
|
||||||
|
"and replaced with the 'args' field. See https://www.consul.io/docs/agent/checks.html",
|
||||||
|
check.CheckID)
|
||||||
|
}
|
||||||
|
|
||||||
if a.dockerClient == nil {
|
if a.dockerClient == nil {
|
||||||
dc, err := NewDockerClient(os.Getenv("DOCKER_HOST"), CheckBufSize)
|
dc, err := NewDockerClient(os.Getenv("DOCKER_HOST"), CheckBufSize)
|
||||||
|
|
|
@ -75,5 +75,5 @@ func (c *CheckType) IsTCP() bool {
|
||||||
|
|
||||||
// IsDocker returns true when checking a docker container.
|
// IsDocker returns true when checking a docker container.
|
||||||
func (c *CheckType) IsDocker() bool {
|
func (c *CheckType) IsDocker() bool {
|
||||||
return c.DockerContainerID != "" && c.Script != "" && c.Interval != 0
|
return c.IsScript() && c.DockerContainerID != "" && c.Interval != 0
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue