From 5c77099df36f2a3c7f35acf4c910acc69e546782 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Sun, 24 Dec 2017 16:26:18 +0000 Subject: [PATCH] render parents which we cannot resolve The id and topology are enough to get some basic info for rendering. This isn't just a fall-through for exceptional cases. ContainerwithImageNameRenderer produces parent references using the image name without version as the ID, and containers-by-image topology uses that for grouping. By contrast, the container-image topology in the report is keyed on docker image IDs. --- render/detailed/parents.go | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/render/detailed/parents.go b/render/detailed/parents.go index 0ad1a44c4a..80913d7bcb 100644 --- a/render/detailed/parents.go +++ b/render/detailed/parents.go @@ -44,19 +44,10 @@ func Parents(r report.Report, n report.Node) []Parent { if topologyID == n.Topology && id == n.ID { continue } - - var parentNode report.Node - // Special case: container image parents should be empty nodes for some reason - if topologyID == report.ContainerImage { + parentNode, ok := topology.Nodes[id] + if !ok { parentNode = report.MakeNode(id).WithTopology(topologyID) - } else { - if parent, ok := topology.Nodes[id]; ok { - parentNode = parent - } else { - continue - } } - apiTopologyID, ok := primaryAPITopology[topologyID] if !ok { continue