join with original renderer in ConnectionJoin

This guarantees that the output won't contain bare nodes containing
just an id and topology, as produced by ipToNode. Previously this was
ensured by calling convention, now it's ensured by construction.
This commit is contained in:
Matthias Radestock
2017-07-13 16:28:02 +01:00
parent 387a68a3c7
commit c7f94d8a74
2 changed files with 9 additions and 12 deletions

View File

@@ -36,12 +36,7 @@ var ContainerRenderer = MakeFilter(
MapProcess2Container,
ColorConnectedProcessRenderer,
),
// This mapper brings in connections by joining with container
// IPs.
ConnectionJoin(MapContainer2IP, SelectContainer),
SelectContainer,
),
)
@@ -68,12 +63,15 @@ func ConnectionJoin(toIPs func(report.Node) []string, r Renderer) Renderer {
return result
}
return MakeMap(
ipToNode,
MakeReduce(
MakeMap(nodeToIP, r),
mapEndpoint2IP,
return MakeReduce(
MakeMap(
ipToNode,
MakeReduce(
MakeMap(nodeToIP, r),
mapEndpoint2IP,
),
),
r,
)
}

View File

@@ -48,8 +48,7 @@ var PodRenderer = ConditionalRenderer(renderKubernetesTopologies,
),
),
),
selectPodsWithDeployments{},
ConnectionJoin(MapPod2IP, SelectPod),
ConnectionJoin(MapPod2IP, selectPodsWithDeployments{}),
),
),
)