set 1ms as container duration minimum value

Signed-off-by: Dong Chen <dongluo.chen@docker.com>
Upstream-commit: d8b6a35d0272d9bb121dda7d0bc53d0e53d8bd22
Component: engine
This commit is contained in:
Dong Chen
2017-04-12 15:45:29 -07:00
parent 47f6ff572e
commit 2f0c087a4c
7 changed files with 72 additions and 28 deletions
+3 -3
View File
@@ -499,16 +499,16 @@ definitions:
items:
type: "string"
Interval:
description: "The time to wait between checks in nanoseconds. It should be 0 or not less than 1000000000(1s). 0 means inherit."
description: "The time to wait between checks in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit."
type: "integer"
Timeout:
description: "The time to wait before considering the check to have hung. It should be 0 or not less than 1000000000(1s). 0 means inherit."
description: "The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit."
type: "integer"
Retries:
description: "The number of consecutive failures needed to consider a container as unhealthy. 0 means inherit."
type: "integer"
StartPeriod:
description: "Start period for the container to initialize before starting health-retries countdown in nanoseconds. 0 means inherit."
description: "Start period for the container to initialize before starting health-retries countdown in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit."
type: "integer"
HostConfig:
@@ -7,6 +7,12 @@ import (
"github.com/docker/go-connections/nat"
)
// MinimumDuration puts a minimum on user configured duration.
// This is to prevent API error on time unit. For example, API may
// set 3 as healthcheck interval with intention of 3 seconds, but
// Docker interprets it as 3 nanoseconds.
const MinimumDuration = 1 * time.Millisecond
// HealthConfig holds configuration settings for the HEALTHCHECK feature.
type HealthConfig struct {
// Test is the test to perform to check that the container is healthy.