From 81fa9855c13db51c16127d4a127db03ff033a2a2 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Wed, 6 Oct 2021 11:32:46 -0400 Subject: [PATCH] Fix quota controller hotloop in integration tests --- pkg/controller/resourcequota/resource_quota_controller.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/controller/resourcequota/resource_quota_controller.go b/pkg/controller/resourcequota/resource_quota_controller.go index 9b0d4f71cd0..7e2f491ee44 100644 --- a/pkg/controller/resourcequota/resource_quota_controller.go +++ b/pkg/controller/resourcequota/resource_quota_controller.go @@ -287,7 +287,11 @@ func (rq *Controller) Run(workers int, stopCh <-chan struct{}) { go wait.Until(rq.worker(rq.missingUsageQueue), time.Second, stopCh) } // the timer for how often we do a full recalculation across all quotas - go wait.Until(func() { rq.enqueueAll() }, rq.resyncPeriod(), stopCh) + if rq.resyncPeriod() > 0 { + go wait.Until(func() { rq.enqueueAll() }, rq.resyncPeriod(), stopCh) + } else { + klog.Warningf("periodic quota controller resync disabled") + } <-stopCh }