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:
Nicolas De Loof
2026-09-23 10:56:23 +02:00
committed by Guillaume Lours
parent 2cc0f0c154
commit 0591c9b3b6
+1
View File
@@ -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)