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>
This commit is contained in:
@ -170,10 +170,16 @@ func getPossibleChips(view treeView) (chips []imageChip) {
|
||||
|
||||
var possible []imageChip
|
||||
for _, img := range view.images {
|
||||
details := []imageDetails{img.Details}
|
||||
|
||||
for _, c := range img.Children {
|
||||
details = append(details, c.Details)
|
||||
}
|
||||
|
||||
for _, d := range details {
|
||||
for idx := len(remaining) - 1; idx >= 0; idx-- {
|
||||
chip := remaining[idx]
|
||||
if chip.check(&c.Details) {
|
||||
if chip.check(&d) {
|
||||
possible = append(possible, chip)
|
||||
remaining = append(remaining[:idx], remaining[idx+1:]...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user