Don't overwrite existing dependency condition

(when service has `volumes_from` another service with dependency condition)

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
This commit is contained in:
Laura Brehm 2022-09-15 09:53:52 -04:00
parent 43c444e890
commit b564cc5a17
No known key found for this signature in database
GPG Key ID: 526E3FC49260D47A
1 changed files with 2 additions and 1 deletions

View File

@ -125,7 +125,8 @@ func prepareVolumes(p *types.Project) error {
p.Services[i].DependsOn = make(types.DependsOnConfig, len(dependServices))
}
for _, service := range p.Services {
if utils.StringContains(dependServices, service.Name) {
if utils.StringContains(dependServices, service.Name) &&
p.Services[i].DependsOn[service.Name].Condition == "" {
p.Services[i].DependsOn[service.Name] = types.ServiceDependency{
Condition: types.ServiceConditionStarted,
}