Adds script warning and fixes Docker args recognition.

pull/3537/head
James Phillips 7 years ago
parent 3675b35235
commit 3bc6df5f0e
No known key found for this signature in database
GPG Key ID: 77183E682AC5FC11

@ -1697,6 +1697,11 @@ func (a *Agent) AddCheck(check *structs.HealthCheck, chkType *structs.CheckType,
check.CheckID, 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 {
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.
func (c *CheckType) IsDocker() bool {
return c.DockerContainerID != "" && c.Script != "" && c.Interval != 0
return c.IsScript() && c.DockerContainerID != "" && c.Interval != 0
}

Loading…
Cancel
Save