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.
This commit is contained in:
Matthias Radestock
2017-12-24 16:26:18 +00:00
parent b88a2e4509
commit 7c5e9339bb

View File

@@ -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