mirror of
https://github.com/docker/compose.git
synced 2025-07-22 05:04:27 +02:00
Merge pull request #8888 from PierreAntoineGuillaume/v2
Fix typo in --wait option mechanism
This commit is contained in:
commit
8f9dc2e7f8
@ -261,7 +261,7 @@ func getContainerProgressName(container moby.Container) string {
|
|||||||
return "Container " + getCanonicalContainerName(container)
|
return "Container " + getCanonicalContainerName(container)
|
||||||
}
|
}
|
||||||
|
|
||||||
const ServiceConditionRuningOrHealthy = "running_or_healthy"
|
const ServiceConditionRunningOrHealthy = "running_or_healthy"
|
||||||
|
|
||||||
func (s *composeService) waitDependencies(ctx context.Context, project *types.Project, dependencies types.DependsOnConfig) error {
|
func (s *composeService) waitDependencies(ctx context.Context, project *types.Project, dependencies types.DependsOnConfig) error {
|
||||||
eg, _ := errgroup.WithContext(ctx)
|
eg, _ := errgroup.WithContext(ctx)
|
||||||
@ -273,7 +273,7 @@ func (s *composeService) waitDependencies(ctx context.Context, project *types.Pr
|
|||||||
for {
|
for {
|
||||||
<-ticker.C
|
<-ticker.C
|
||||||
switch config.Condition {
|
switch config.Condition {
|
||||||
case ServiceConditionRuningOrHealthy:
|
case ServiceConditionRunningOrHealthy:
|
||||||
healthy, err := s.isServiceHealthy(ctx, project, dep, true)
|
healthy, err := s.isServiceHealthy(ctx, project, dep, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -69,7 +69,7 @@ func (s *composeService) start(ctx context.Context, project *types.Project, opti
|
|||||||
depends := types.DependsOnConfig{}
|
depends := types.DependsOnConfig{}
|
||||||
for _, s := range project.Services {
|
for _, s := range project.Services {
|
||||||
depends[s.Name] = types.ServiceDependency{
|
depends[s.Name] = types.ServiceDependency{
|
||||||
Condition: ServiceConditionRuningOrHealthy,
|
Condition: ServiceConditionRunningOrHealthy,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
err = s.waitDependencies(ctx, project, depends)
|
err = s.waitDependencies(ctx, project, depends)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user