From e66d34d7bbf6129d8b64cf4a3cb706aeb194ee1a Mon Sep 17 00:00:00 2001 From: Nikita Pivkin Date: Wed, 29 Jan 2025 10:57:25 +0600 Subject: [PATCH] feat: export healthcheck start-interval from config Signed-off-by: Nikita Pivkin --- pkg/v1/config.go | 7 ++++--- pkg/v1/daemon/image.go | 11 ++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/pkg/v1/config.go b/pkg/v1/config.go index 960c93b5f..59e04d398 100644 --- a/pkg/v1/config.go +++ b/pkg/v1/config.go @@ -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. diff --git a/pkg/v1/daemon/image.go b/pkg/v1/daemon/image.go index c99e94a24..e8735add9 100644 --- a/pkg/v1/daemon/image.go +++ b/pkg/v1/daemon/image.go @@ -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, } }