Skip to content

Commit

Permalink
Support start_period for healthcheck in Docker Compose
Browse files Browse the repository at this point in the history
Signed-off-by: Li Yi <denverdino@gmail.com>
  • Loading branch information
denverdino committed Aug 29, 2017
1 parent 21b5bbe commit 0abdad6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions cli/compose/loader/full-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ services:
interval: 10s
timeout: 1s
retries: 5
start_period: 15s

# Any valid image reference - repo, tag, id, sha
image: redis
Expand Down
9 changes: 5 additions & 4 deletions cli/compose/loader/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -756,10 +756,11 @@ func TestFullExample(t *testing.T) {
"somehost": "162.242.195.82",
},
HealthCheck: &types.HealthCheckConfig{
Test: types.HealthCheckTest([]string{"CMD-SHELL", "echo \"hello world\""}),
Interval: "10s",
Timeout: "1s",
Retries: uint64Ptr(5),
Test: types.HealthCheckTest([]string{"CMD-SHELL", "echo \"hello world\""}),
Interval: "10s",
Timeout: "1s",
Retries: uint64Ptr(5),
StartPeriod: "15s",
},
Hostname: "foo",
Image: "redis",
Expand Down
2 changes: 1 addition & 1 deletion cli/compose/schema/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cli/compose/schema/data/config_schema_v3.4.json
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@
{"type": "array", "items": {"type": "string"}}
]
},
"timeout": {"type": "string"}
"timeout": {"type": "string"},
"start_period": {"type": "string"}
}
},
"deployment": {
Expand Down
2 changes: 1 addition & 1 deletion cli/compose/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ type HealthCheckConfig struct {
Timeout string
Interval string
Retries *uint64
StartPeriod string
StartPeriod string `mapstructure:"start_period"`
Disable bool
}

Expand Down

0 comments on commit 0abdad6

Please sign in to comment.