Commit 6ff56c8
Fix unsafe container cleanup in delete_image
Previously, delete_image stopped ALL containers on the system before
removing test images, which could disrupt unrelated containers.
Changes:
- Only stop and remove containers created from the specific test image
- Match containers using substring comparison to handle sha256: prefix
- Check container state before stopping to avoid unnecessary operations
- Handle NotModifiedError for already-stopped containers
This makes the test suite safe to run on development machines where
other Docker containers may be running.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>1 parent 455980a commit 6ff56c8
1 file changed
+15
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
21 | 33 | | |
22 | 34 | | |
23 | 35 | | |
| |||
0 commit comments