Преглед на файлове

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 преди 3 години
родител
ревизия
b564cc5a17
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  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))
 			}
 			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,
 					}