Skip to content

Commit 23fe9ec

Browse files
committed
image/tree: Fix top image chip detection
Currently, image tree visualization doesn't properly detect chips for parent images, only looking at child images. This patch fixes the issue by checking both parent and child images when determining which chips to display in the tree view. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
1 parent ab2d683 commit 23fe9ec

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

cli/command/image/tree.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,16 @@ func getPossibleChips(view treeView) (chips []imageChip) {
170170

171171
var possible []imageChip
172172
for _, img := range view.images {
173+
details := []imageDetails{img.Details}
174+
173175
for _, c := range img.Children {
176+
details = append(details, c.Details)
177+
}
178+
179+
for _, d := range details {
174180
for idx := len(remaining) - 1; idx >= 0; idx-- {
175181
chip := remaining[idx]
176-
if chip.check(&c.Details) {
182+
if chip.check(&d) {
177183
possible = append(possible, chip)
178184
remaining = append(remaining[:idx], remaining[idx+1:]...)
179185
}

0 commit comments

Comments
 (0)