Skip to content

Commit

Permalink
added healthcheck to config struct and healthcheck struct (#138)
Browse files Browse the repository at this point in the history
* added healthcheck to config struct and healthcheck struct

* added test tag to HealthConfig Test

* Revert "added test tag to HealthConfig Test"

This reverts commit 94957d1.
  • Loading branch information
chrisz100 authored and dlorenc committed May 14, 2018
1 parent fc1c0d6 commit ee5a6c2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions v1/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,27 @@ type RootFS struct {
DiffIDs []Hash `json:"diff_ids"`
}

// HealthConfig holds configuration settings for the HEALTHCHECK feature.
type HealthConfig struct {
// Test is the test to perform to check that the container is healthy.
// An empty slice means to inherit the default.
// The options are:
// {} : inherit healthcheck
// {"NONE"} : disable healthcheck
// {"CMD", args...} : exec arguments directly
// {"CMD-SHELL", command} : run command with system's default shell
Test []string `json:",omitempty"`

// Zero means to inherit. Durations are expressed as integer nanoseconds.
Interval time.Duration `json:",omitempty"` // Interval is the time to wait between checks.
Timeout time.Duration `json:",omitempty"` // Timeout is the time to wait before considering the check to have hung.
StartPeriod time.Duration `json:",omitempty"` // The start period for the container to initialize before the retries starts to count down.

// Retries is the number of consecutive failures needed to consider a container as unhealthy.
// Zero means inherit.
Retries int `json:",omitempty"`
}

// Config is a submessage of the config file described as:
// The execution parameters which SHOULD be used as a base when running
// a container using the image.
Expand All @@ -77,6 +98,7 @@ type Config struct {
AttachStdin bool
AttachStdout bool
Cmd []string
Healthcheck *HealthConfig
Domainname string
Entrypoint []string
Env []string
Expand Down

0 comments on commit ee5a6c2

Please sign in to comment.