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

Function getDependencyCondition

pkg/compose/start.go:102–111  ·  pkg/compose/start.go::getDependencyCondition

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)

Source from the content-addressed store, hash-verified

100// with service_completed_successfully condition, and applies that condition
101// instead, or --wait will never finish waiting for one-shot containers
102func 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}

Callers 1

startMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected