Prevent division by 0 error in resource-gatherer

pull/6/head
gmarek 2016-05-17 14:35:48 +02:00
parent 1738bbfe5f
commit 0848ad2201
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) {
if len(g.workers) == 0 {
return
}
delayPeriod := resourceDataGatheringPeriod / time.Duration(len(g.workers))
delay := time.Duration(0)
for i := range g.workers {