mirror of https://github.com/k3s-io/k3s
Merge pull request #25740 from gmarek/gatherer
Prevent division by 0 error in resource-gathererpull/6/head
commit
9990f843cd
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue