Merge pull request #25740 from gmarek/gatherer

Prevent division by 0 error in resource-gatherer
pull/6/head
Wojciech Tyczynski 2016-05-17 15:21:14 +02:00
commit 9990f843cd
1 changed files with 3 additions and 0 deletions

View File

@ -205,6 +205,9 @@ func getKubemarkMasterComponentsResourceUsage() ResourceUsagePerContainer {
} }
func (g *containerResourceGatherer) getKubeSystemContainersResourceUsage(c *client.Client) { func (g *containerResourceGatherer) getKubeSystemContainersResourceUsage(c *client.Client) {
if len(g.workers) == 0 {
return
}
delayPeriod := resourceDataGatheringPeriod / time.Duration(len(g.workers)) delayPeriod := resourceDataGatheringPeriod / time.Duration(len(g.workers))
delay := time.Duration(0) delay := time.Duration(0)
for i := range g.workers { for i := range g.workers {