Skip to content

Commit

Permalink
Merge pull request #437 from glours/add_start_interval
Browse files Browse the repository at this point in the history
  • Loading branch information
ndeloof authored Jul 15, 2023
2 parents 2cef411 + e9919f6 commit e4d696a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
1 change: 1 addition & 0 deletions loader/full-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ services:
timeout: 1s
retries: 5
start_period: 15s
start_interval: 5s

# Any valid image reference - repo, tag, id, sha
image: redis
Expand Down
15 changes: 9 additions & 6 deletions loader/full-struct_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,12 @@ func services(workingDir, homeDir string) []types.ServiceConfig {
"x-foo": "bar",
},
HealthCheck: &types.HealthCheckConfig{
Test: types.HealthCheckTest([]string{"CMD-SHELL", "echo \"hello world\""}),
Interval: durationPtr(10 * time.Second),
Timeout: durationPtr(1 * time.Second),
Retries: uint64Ptr(5),
StartPeriod: durationPtr(15 * time.Second),
Test: types.HealthCheckTest([]string{"CMD-SHELL", "echo \"hello world\""}),
Interval: durationPtr(10 * time.Second),
Timeout: durationPtr(1 * time.Second),
Retries: uint64Ptr(5),
StartPeriod: durationPtr(15 * time.Second),
StartInterval: durationPtr(5 * time.Second),
},
Hostname: "foo",
Image: "redis",
Expand Down Expand Up @@ -751,6 +752,7 @@ services:
interval: 10s
retries: 5
start_period: 15s
start_interval: 5s
image: redis
ipc: host
labels:
Expand Down Expand Up @@ -1358,7 +1360,8 @@ func fullExampleJSON(workingDir, homeDir string) string {
"timeout": "1s",
"interval": "10s",
"retries": 5,
"start_period": "15s"
"start_period": "15s",
"start_interval": "5s"
},
"image": "redis",
"ipc": "host",
Expand Down
3 changes: 2 additions & 1 deletion schema/compose-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,8 @@
]
},
"timeout": {"type": "string", "format": "duration"},
"start_period": {"type": "string", "format": "duration"}
"start_period": {"type": "string", "format": "duration"},
"start_interval": {"type": "string", "format": "duration"}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
Expand Down
13 changes: 7 additions & 6 deletions types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,12 +603,13 @@ type DeployConfig struct {

// HealthCheckConfig the healthcheck configuration for a service
type HealthCheckConfig struct {
Test HealthCheckTest `yaml:"test,omitempty" json:"test,omitempty"`
Timeout *Duration `yaml:"timeout,omitempty" json:"timeout,omitempty"`
Interval *Duration `yaml:"interval,omitempty" json:"interval,omitempty"`
Retries *uint64 `yaml:"retries,omitempty" json:"retries,omitempty"`
StartPeriod *Duration `yaml:"start_period,omitempty" json:"start_period,omitempty"`
Disable bool `yaml:"disable,omitempty" json:"disable,omitempty"`
Test HealthCheckTest `yaml:"test,omitempty" json:"test,omitempty"`
Timeout *Duration `yaml:"timeout,omitempty" json:"timeout,omitempty"`
Interval *Duration `yaml:"interval,omitempty" json:"interval,omitempty"`
Retries *uint64 `yaml:"retries,omitempty" json:"retries,omitempty"`
StartPeriod *Duration `yaml:"start_period,omitempty" json:"start_period,omitempty"`
StartInterval *Duration `yaml:"start_interval,omitempty" json:"start_interval,omitempty"`
Disable bool `yaml:"disable,omitempty" json:"disable,omitempty"`

Extensions Extensions `yaml:"#extensions,inline" json:"-"`
}
Expand Down

0 comments on commit e4d696a

Please sign in to comment.