Skip to content

Commit 9e79377

Browse files
committed
image/tree: Fix dangling filter condition
The logic for applying the dangling filter when `--all` is not used was inverted. The filter was being applied when the dangling filter was present, but it should be applied when the dangling filter is NOT present. Signed-off-by: Paweł Gronowski <[email protected]>
1 parent 513ee76 commit 9e79377

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cli/command/image/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func runImages(ctx context.Context, dockerCLI command.Cli, options imagesOptions
116116
}
117117
images := res.Items
118118
if !options.all {
119-
if _, ok := filters["dangling"]; ok {
119+
if _, ok := filters["dangling"]; !ok {
120120
images = slices.DeleteFunc(images, isDangling)
121121
}
122122
}

0 commit comments

Comments
 (0)