mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-06 03:31:00 +00:00
Merge pull request #2726 from weaveworks/mike/render/fix-no-pods-minor-label
render: In minor labels, display '0 things' instead of blank if zero things present
This commit is contained in:
@@ -344,13 +344,14 @@ func groupNodeSummary(base NodeSummary, r report.Report, n report.Node) (NodeSum
|
||||
}
|
||||
|
||||
func pluralize(counters report.Counters, key, singular, plural string) string {
|
||||
if c, ok := counters.Lookup(key); ok {
|
||||
if c == 1 {
|
||||
return fmt.Sprintf("%d %s", c, singular)
|
||||
}
|
||||
return fmt.Sprintf("%d %s", c, plural)
|
||||
c, ok := counters.Lookup(key)
|
||||
if !ok {
|
||||
c = 0
|
||||
}
|
||||
return ""
|
||||
if c == 1 {
|
||||
return fmt.Sprintf("%d %s", c, singular)
|
||||
}
|
||||
return fmt.Sprintf("%d %s", c, plural)
|
||||
}
|
||||
|
||||
type nodeSummariesByID []NodeSummary
|
||||
|
||||
Reference in New Issue
Block a user