Skip to content

Commit

Permalink
feat: export healthcheck start-interval from config
Browse files Browse the repository at this point in the history
Signed-off-by: Nikita Pivkin <[email protected]>
  • Loading branch information
nikpivkin committed Jan 29, 2025
1 parent c4dd792 commit e66d34d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
7 changes: 4 additions & 3 deletions pkg/v1/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ type HealthConfig struct {
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.
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.
StartInterval time.Duration `json:",omitempty"` // The interval to attempt healthchecks at during the start period

// Retries is the number of consecutive failures needed to consider a container as unhealthy.
// Zero means inherit.
Expand Down
11 changes: 6 additions & 5 deletions pkg/v1/daemon/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,12 @@ func (i *image) computeImageConfig(config *container.Config) v1.Config {

if config.Healthcheck != nil {
c.Healthcheck = &v1.HealthConfig{
Test: config.Healthcheck.Test,
Interval: config.Healthcheck.Interval,
Timeout: config.Healthcheck.Timeout,
StartPeriod: config.Healthcheck.StartPeriod,
Retries: config.Healthcheck.Retries,
Test: config.Healthcheck.Test,
Interval: config.Healthcheck.Interval,
Timeout: config.Healthcheck.Timeout,
StartPeriod: config.Healthcheck.StartPeriod,
StartInterval: config.Healthcheck.StartInterval,
Retries: config.Healthcheck.Retries,
}
}

Expand Down

0 comments on commit e66d34d

Please sign in to comment.