From b564cc5a1745ec00bd1e9217515b5eacf51deee9 Mon Sep 17 00:00:00 2001 From: Laura Brehm Date: Thu, 15 Sep 2022 09:53:52 -0400 Subject: [PATCH] Don't overwrite existing dependency condition (when service has `volumes_from` another service with dependency condition) Signed-off-by: Laura Brehm --- pkg/compose/create.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/compose/create.go b/pkg/compose/create.go index 74a2184ac..a0b74a0e5 100644 --- a/pkg/compose/create.go +++ b/pkg/compose/create.go @@ -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, }