Skip to content

Commit

Permalink
Fix for displaying naked pods
Browse files Browse the repository at this point in the history
  • Loading branch information
benc-uk committed Aug 1, 2019
1 parent 0a4e477 commit f85c69e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions web/client/src/components/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,15 @@ export default {
if(!this.filterShowNode(pod)) continue
// Add pods to containing group (ReplicaSet, DaemonSet, StatefulSet) that 'owns' them
let owner = pod.metadata.ownerReferences[0];
let groupId = `grp_${owner.kind}_${owner.name}`
this.addNode(pod, 'Pod', this.calcStatus(pod), groupId)
if(pod.metadata.ownerReferences) {
// Most pods have owning set (rs, ds, sts) so are in a group
let owner = pod.metadata.ownerReferences[0];
let groupId = `grp_${owner.kind}_${owner.name}`
this.addNode(pod, 'Pod', this.calcStatus(pod), groupId)
} else {
// Naked pods don't go into groups
this.addNode(pod, 'Pod', this.calcStatus(pod))
}
// Add PVCs linked to Pod
for(let vol of pod.spec.volumes || []) {
Expand Down

0 comments on commit f85c69e

Please sign in to comment.