浏览代码

include services declared by `links` as implicit dependencies

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof 3 年之前
父节点
当前提交
e766352d81
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      pkg/compose/create.go

+ 4 - 0
pkg/compose/create.go

@@ -173,6 +173,10 @@ func prepareServicesDependsOn(p *types.Project) error {
 			dependencies = append(dependencies, spec[0])
 		}
 
+		for _, link := range service.Links {
+			dependencies = append(dependencies, strings.Split(link, ":")[0])
+		}
+
 		if len(dependencies) == 0 {
 			continue
 		}