Skip to content

Commit

Permalink
Propagate the pod counter from replicasets for deployments.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwilkie committed May 19, 2016
1 parent 24062be commit 5f995ae
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions render/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5f995ae

Please sign in to comment.