Skip to content

Commit

Permalink
filter out deleted pods when calculating available namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbellamy committed Apr 29, 2016
1 parent 4586d54 commit 64c9ff6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/api_topologies.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ func updateFilters(rpt report.Report, topologies []APITopologyDesc) []APITopolog
namespaces := map[string]struct{}{}
for _, t := range []report.Topology{rpt.Pod, rpt.Service} {
for _, n := range t.Nodes {
if state, ok := n.Latest.Lookup(kubernetes.PodState); ok && state == kubernetes.StateDeleted {
continue
}
if namespace, ok := n.Latest.Lookup(kubernetes.Namespace); ok {
namespaces[namespace] = struct{}{}
}
Expand Down

0 comments on commit 64c9ff6

Please sign in to comment.