Skip to content

Commit 7f545bc

Browse files
committed
fix regression considering volumes-from: container a dependency
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 298fa92 commit 7f545bc

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

loader/normalize.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func Normalize(project *types.Project, resolvePaths bool) error {
117117
}
118118

119119
for _, vol := range s.VolumesFrom {
120-
if !strings.HasPrefix(s.Pid, types.ContainerPrefix) {
120+
if !strings.HasPrefix(vol, types.ContainerPrefix) {
121121
spec := strings.Split(vol, ":")
122122
s.DependsOn = setIfMissing(s.DependsOn, spec[0], types.ServiceDependency{
123123
Condition: types.ServiceConditionStarted,

loader/normalize_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,11 @@ func TestNormalizeDependsOn(t *testing.T) {
201201
NetworkMode: "service:zot",
202202
},
203203
{
204-
Name: "bar",
205-
VolumesFrom: []string{"zot"},
204+
Name: "bar",
205+
VolumesFrom: []string{
206+
"zot",
207+
"container:xxx",
208+
},
206209
},
207210
{
208211
Name: "zot",
@@ -220,6 +223,7 @@ services:
220223
default: null
221224
volumes_from:
222225
- zot
226+
- container:xxx
223227
foo:
224228
depends_on:
225229
bar:

0 commit comments

Comments
 (0)