Explorar o código

Don't overwrite existing dependency condition

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

Signed-off-by: Laura Brehm <[email protected]>
Laura Brehm %!s(int64=3) %!d(string=hai) anos
pai
achega
b564cc5a17
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      pkg/compose/create.go

+ 2 - 1
pkg/compose/create.go

@@ -125,7 +125,8 @@ func prepareVolumes(p *types.Project) error {
 				p.Services[i].DependsOn = make(types.DependsOnConfig, len(dependServices))
 				p.Services[i].DependsOn = make(types.DependsOnConfig, len(dependServices))
 			}
 			}
 			for _, service := range p.Services {
 			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{
 					p.Services[i].DependsOn[service.Name] = types.ServiceDependency{
 						Condition: types.ServiceConditionStarted,
 						Condition: types.ServiceConditionStarted,
 					}
 					}