Merge pull request #1530 from weaveworks/1514-deployment-pods

Propagate the pod counter from replicasets for deployments.
This commit is contained in:
Paul Bellamy
2016-05-19 14:31:20 +01:00

View File

@@ -150,6 +150,15 @@ func Map2Parent(topology string) func(n report.Node, _ report.Networks) report.N
for _, id := range groupIDs {
node := NewDerivedNode(id, n).WithTopology(topology)
node.Counters = node.Counters.Add(n.Topology, 1)
// When mapping replica(tionController)s(ets) to deployments
// we must propagate the pod counter.
if n.Topology != report.Pod {
if count, ok := n.Counters.Lookup(report.Pod); ok {
node.Counters = node.Counters.Add(report.Pod, count)
}
}
result[id] = node
}
return result