mirror of
https://github.com/weaveworks/scope.git
synced 2026-08-18 20:07:06 +00:00
WIP: convert MapContainerImage2Name to a Renderer
This commit is contained in:
@@ -158,6 +158,7 @@ type joinResults struct {
|
||||
multi map[string][]string // input node ID -> output node IDs - exceptional case
|
||||
}
|
||||
|
||||
// Create a joinResults with a starting set of nodes, that other info will be added into.
|
||||
func newJoinResults(inputNodes report.Nodes) joinResults {
|
||||
nodes := make(report.Nodes, len(inputNodes))
|
||||
for id, n := range inputNodes {
|
||||
@@ -217,6 +218,19 @@ func (ret *joinResults) addChildAndChildren(m report.Node, id string, topology s
|
||||
ret.mapChild(m.ID, id)
|
||||
}
|
||||
|
||||
func (ret *joinResults) addWithCreate(m report.Node, id string, create func() report.Node) {
|
||||
result, exists := ret.nodes[id]
|
||||
if !exists {
|
||||
result = create()
|
||||
ret.nodes[id] = result
|
||||
}
|
||||
ret.addUnmappedChild(m, id, result.Topology)
|
||||
result = ret.nodes[id]
|
||||
result.Children.UnsafeMerge(m.Children)
|
||||
ret.nodes[id] = result
|
||||
ret.mapChild(m.ID, id)
|
||||
}
|
||||
|
||||
// Add a copy of n straight into the results
|
||||
func (ret *joinResults) passThrough(n report.Node) {
|
||||
n.Adjacency = nil // result() assumes all nodes start with no adjacencies
|
||||
|
||||
Reference in New Issue
Block a user