image/tree: Fix untagged images in non-expanded view

In the expanded view there is a separate image entry per each tag.

Fix a bug which caused no entry to be added for untagged images.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski
2025-11-13 12:46:05 +01:00
parent c44e8a0727
commit b66b93130c

View File

@ -111,6 +111,13 @@ func runTree(ctx context.Context, dockerCLI command.Cli, opts treeOptions) (int,
continue
}
if len(sortedTags) == 0 {
view.images = append(view.images, topImage{
Details: topDetails,
Children: children,
created: img.Created,
})
}
for _, tag := range sortedTags {
view.images = append(view.images, topImage{
Names: []string{tag},