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 <pawel.gronowski@docker.com>
This commit is contained in:
@ -116,7 +116,7 @@ func runImages(ctx context.Context, dockerCLI command.Cli, options imagesOptions
|
||||
}
|
||||
images := res.Items
|
||||
if !options.all {
|
||||
if _, ok := filters["dangling"]; ok {
|
||||
if _, ok := filters["dangling"]; !ok {
|
||||
images = slices.DeleteFunc(images, isDangling)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user