Skip to content

Commit

Permalink
Simplify node names even if pods are missing a node
Browse files Browse the repository at this point in the history
  • Loading branch information
howardjohn committed Jul 3, 2019
1 parent 5d984b9 commit 54c6f4d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/writer/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ func simplifyPodNames(resources []*model.PodResource) {
func simplifyNodeNames(resources []*model.PodResource) {
var nameParts []util.Part
for _, pod := range resources {
nameParts = append(nameParts, strings.Split(pod.Node, "-"))
if len(pod.Node) > 0 {
nameParts = append(nameParts, strings.Split(pod.Node, "-"))
}
}
lcp := strings.Join(util.LongestCommonPrefix(nameParts), "-") + "-"
for _, pod := range resources {
Expand Down

0 comments on commit 54c6f4d

Please sign in to comment.