mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Since replenishmentControllers was generated by ctx.InformerFactory, remove "replenishmentControllers []cache.Controller" which is never used.
This commit is contained in:
parent
d7e56d5330
commit
efdf99d09a
@ -79,21 +79,18 @@ type ResourceQuotaController struct {
|
|||||||
resyncPeriod controller.ResyncPeriodFunc
|
resyncPeriod controller.ResyncPeriodFunc
|
||||||
// knows how to calculate usage
|
// knows how to calculate usage
|
||||||
registry quota.Registry
|
registry quota.Registry
|
||||||
// controllers monitoring to notify for replenishment
|
|
||||||
replenishmentControllers []cache.Controller
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewResourceQuotaController(options *ResourceQuotaControllerOptions) *ResourceQuotaController {
|
func NewResourceQuotaController(options *ResourceQuotaControllerOptions) *ResourceQuotaController {
|
||||||
// build the resource quota controller
|
// build the resource quota controller
|
||||||
rq := &ResourceQuotaController{
|
rq := &ResourceQuotaController{
|
||||||
rqClient: options.QuotaClient,
|
rqClient: options.QuotaClient,
|
||||||
rqLister: options.ResourceQuotaInformer.Lister(),
|
rqLister: options.ResourceQuotaInformer.Lister(),
|
||||||
informerSyncedFuncs: []cache.InformerSynced{options.ResourceQuotaInformer.Informer().HasSynced},
|
informerSyncedFuncs: []cache.InformerSynced{options.ResourceQuotaInformer.Informer().HasSynced},
|
||||||
queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "resourcequota_primary"),
|
queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "resourcequota_primary"),
|
||||||
missingUsageQueue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "resourcequota_priority"),
|
missingUsageQueue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "resourcequota_priority"),
|
||||||
resyncPeriod: options.ResyncPeriod,
|
resyncPeriod: options.ResyncPeriod,
|
||||||
registry: options.Registry,
|
registry: options.Registry,
|
||||||
replenishmentControllers: []cache.Controller{},
|
|
||||||
}
|
}
|
||||||
// set the synchronization handler
|
// set the synchronization handler
|
||||||
rq.syncHandler = rq.syncResourceQuotaFromKey
|
rq.syncHandler = rq.syncResourceQuotaFromKey
|
||||||
@ -238,11 +235,6 @@ func (rq *ResourceQuotaController) Run(workers int, stopCh <-chan struct{}) {
|
|||||||
glog.Infof("Starting resource quota controller")
|
glog.Infof("Starting resource quota controller")
|
||||||
defer glog.Infof("Shutting down resource quota controller")
|
defer glog.Infof("Shutting down resource quota controller")
|
||||||
|
|
||||||
// the controllers that replenish other resources to respond rapidly to state changes
|
|
||||||
for _, replenishmentController := range rq.replenishmentControllers {
|
|
||||||
go replenishmentController.Run(stopCh)
|
|
||||||
}
|
|
||||||
|
|
||||||
if !controller.WaitForCacheSync("resource quota", stopCh, rq.informerSyncedFuncs...) {
|
if !controller.WaitForCacheSync("resource quota", stopCh, rq.informerSyncedFuncs...) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user