resourcequota: use dynamic informer

The resource quota controller should use a dynamic informer so it
can create informer for custom resources.
This commit is contained in:
zhouhaibing089
2018-12-27 15:37:15 -08:00
committed by haibzhou
parent a8cbb22506
commit f58c2ae62d
10 changed files with 202 additions and 27 deletions

View File

@@ -23,13 +23,12 @@ package app
import (
"fmt"
"net"
"net/http"
"strings"
"time"
"k8s.io/klog"
"net/http"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
utilfeature "k8s.io/apiserver/pkg/util/feature"
@@ -295,7 +294,7 @@ func startResourceQuotaController(ctx ControllerContext) (http.Handler, bool, er
QuotaClient: resourceQuotaControllerClient.CoreV1(),
ResourceQuotaInformer: ctx.InformerFactory.Core().V1().ResourceQuotas(),
ResyncPeriod: controller.StaticResyncPeriodFunc(ctx.ComponentConfig.ResourceQuotaController.ResourceQuotaSyncPeriod.Duration),
InformerFactory: ctx.InformerFactory,
InformerFactory: ctx.GenericInformerFactory,
ReplenishmentResyncPeriod: ctx.ResyncPeriod,
DiscoveryFunc: discoveryFunc,
IgnoredResourcesFunc: quotaConfiguration.IgnoredResources,