mirror of
https://github.com/docker/compose.git
synced 2026-10-12 02:13:08 +00:00
fix(e2e): stop scanning mounts after a matching bind entry is found
BindMountSource kept iterating after locating the bind mount at the expected destination, so a hypothetical second bind entry at the same target would trip a spurious mismatch even though the first entry already confirmed the source. Break out of the loop once a match is found, per docker-agent review feedback on #14234. Signed-off-by: Nicolas De Loof <[email protected]>
This commit is contained in:
committed by
Guillaume Lours
parent
2cc0f0c154
commit
0591c9b3b6
@@ -597,6 +597,7 @@ func BindMountSource(service, target, wantSource string) Check {
|
||||
if m.Source != wantAbs {
|
||||
return fmt.Errorf("container %s mount %s resolves to %s, want %s", c.Name, target, m.Source, wantAbs)
|
||||
}
|
||||
break
|
||||
}
|
||||
if !found {
|
||||
return fmt.Errorf("container %s has no mount at %s", c.Name, target)
|
||||
|
||||
Reference in New Issue
Block a user