getDependencyCondition checks if service is depended on by other services with service_completed_successfully condition, and applies that condition instead, or --wait will never finish waiting for one-shot containers
(service types.ServiceConfig, project *types.Project)
| 100 | // with service_completed_successfully condition, and applies that condition |
| 101 | // instead, or --wait will never finish waiting for one-shot containers |
| 102 | func getDependencyCondition(service types.ServiceConfig, project *types.Project) string { |
| 103 | for _, services := range project.Services { |
| 104 | for dependencyService, dependencyConfig := range services.DependsOn { |
| 105 | if dependencyService == service.Name && dependencyConfig.Condition == types.ServiceConditionCompletedSuccessfully { |
| 106 | return types.ServiceConditionCompletedSuccessfully |
| 107 | } |
| 108 | } |
| 109 | } |
| 110 | return ServiceConditionRunningOrHealthy |
| 111 | } |