Skip to content

Commit

Permalink
render parents which we cannot resolve
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rade committed Dec 26, 2017
1 parent 4b1ab76 commit 5c77099
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions render/detailed/parents.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5c77099

Please sign in to comment.