Add health start interval

This adds an additional interval to be used by healthchecks during the
start period.
Typically when a container is just starting you want to check if it is
ready more quickly than a typical healthcheck might run. Without this
users have to balance between running healthchecks to frequently vs
taking a very long time to mark a container as healthy for the first
time.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Brian Goff
2020-05-02 14:06:18 -07:00
parent 11c6ec6eb2
commit 2216d3ca8d
8 changed files with 112 additions and 6 deletions

View File

@@ -92,6 +92,9 @@ func merge(userConf, imageConf *containertypes.Config) error {
if userConf.Healthcheck.StartPeriod == 0 {
userConf.Healthcheck.StartPeriod = imageConf.Healthcheck.StartPeriod
}
if userConf.Healthcheck.StartInterval == 0 {
userConf.Healthcheck.StartInterval = imageConf.Healthcheck.StartInterval
}
if userConf.Healthcheck.Retries == 0 {
userConf.Healthcheck.Retries = imageConf.Healthcheck.Retries
}