Add readiness healthcheck generation by label (#1366)

This commit is contained in:
João Vitor Paes de Barros do Carmo
2021-03-17 18:02:50 +08:00
committed by GitHub
parent 76565d80b2
commit 0036f0c32b
6 changed files with 184 additions and 10 deletions
+7 -1
View File
@@ -137,7 +137,7 @@ type ServiceConfig struct {
GroupAdd []int64 `compose:"group_add"`
Volumes []Volumes `compose:""`
Secrets []dockerCliTypes.ServiceSecretConfig
HealthChecks HealthCheck `compose:""`
HealthChecks HealthChecks `compose:""`
Placement map[string]string `compose:""`
//This is for long LONG SYNTAX link(https://docs.docker.com/compose/compose-file/#long-syntax)
Configs []dockerCliTypes.ServiceConfigObjConfig `compose:""`
@@ -147,6 +147,12 @@ type ServiceConfig struct {
WithKomposeAnnotation bool `compose:""`
}
// HealthChecks used to distinguish between liveness and readiness
type HealthChecks struct {
Liveness HealthCheck
Readiness HealthCheck
}
// HealthCheck the healthcheck configuration for a service
// "StartPeriod" is not yet added to compose, see:
// https://github.com/docker/cli/issues/116