MCPcopy
hub / github.com/docker/compose / toComposeHealthCheck

Method toComposeHealthCheck

pkg/compose/generate.go:144–168  ·  view source on GitHub ↗
(healthConfig *container.HealthConfig)

Source from the content-addressed store, hash-verified

142}
143
144func (s *composeService) toComposeHealthCheck(healthConfig *container.HealthConfig) *types.HealthCheckConfig {
145 var healthCheck types.HealthCheckConfig
146 healthCheck.Test = healthConfig.Test
147 if healthConfig.Timeout != 0 {
148 timeout := types.Duration(healthConfig.Timeout)
149 healthCheck.Timeout = &timeout
150 }
151 if healthConfig.Interval != 0 {
152 interval := types.Duration(healthConfig.Interval)
153 healthCheck.Interval = &interval
154 }
155 if healthConfig.StartPeriod != 0 {
156 startPeriod := types.Duration(healthConfig.StartPeriod)
157 healthCheck.StartPeriod = &startPeriod
158 }
159 if healthConfig.StartInterval != 0 {
160 startInterval := types.Duration(healthConfig.StartInterval)
161 healthCheck.StartInterval = &startInterval
162 }
163 if healthConfig.Retries != 0 {
164 retries := uint64(healthConfig.Retries)
165 healthCheck.Retries = &retries
166 }
167 return &healthCheck
168}
169
170func (s *composeService) toComposeVolumes(volumes []container.MountPoint) (map[string]types.VolumeConfig,
171 []types.ServiceVolumeConfig, map[string]types.SecretConfig, []types.ServiceSecretConfig,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected