image/tree: Only show untagged images when --all flag is used

In non-expanded view, untagged images should only be displayed when the
--all flag is explicitly provided by the user.

Previously, untagged images were accidentally always shown in the
non-expanded view regardless of the --all flag setting.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski
2025-11-13 20:23:42 +01:00
parent 2cfd9df568
commit 207bf52c27

View File

@ -111,7 +111,7 @@ func runTree(ctx context.Context, dockerCLI command.Cli, opts treeOptions) (int,
continue
}
if len(sortedTags) == 0 {
if opts.all && len(sortedTags) == 0 {
view.images = append(view.images, topImage{
Details: topDetails,
Children: children,