Move informer_factory to staging

This commit is contained in:
cici37
2020-10-29 10:54:38 -07:00
parent 917dcbabe1
commit a91a2cdad6
16 changed files with 52 additions and 20 deletions

View File

@@ -37,6 +37,7 @@ go_library(
"//staging/src/k8s.io/client-go/listers/core/v1:go_default_library",
"//staging/src/k8s.io/client-go/tools/cache:go_default_library",
"//staging/src/k8s.io/client-go/util/workqueue:go_default_library",
"//staging/src/k8s.io/controller-manager/pkg/informerfactory:go_default_library",
"//vendor/k8s.io/klog/v2:go_default_library",
],
)

View File

@@ -42,6 +42,7 @@ import (
corelisters "k8s.io/client-go/listers/core/v1"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/util/workqueue"
"k8s.io/controller-manager/pkg/informerfactory"
"k8s.io/kubernetes/pkg/controller"
)
@@ -69,7 +70,7 @@ type ControllerOptions struct {
// InformersStarted knows if informers were started.
InformersStarted <-chan struct{}
// InformerFactory interfaces with informers.
InformerFactory controller.InformerFactory
InformerFactory informerfactory.InformerFactory
// Controls full resync of objects monitored for replenishment.
ReplenishmentResyncPeriod controller.ResyncPeriodFunc
}

View File

@@ -34,6 +34,7 @@ import (
"k8s.io/apiserver/pkg/quota/v1/generic"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/util/workqueue"
"k8s.io/controller-manager/pkg/informerfactory"
"k8s.io/kubernetes/pkg/controller"
"k8s.io/kubernetes/pkg/quota/v1/evaluator/core"
)
@@ -87,7 +88,7 @@ type QuotaMonitor struct {
resourceChanges workqueue.RateLimitingInterface
// interfaces with informers
informerFactory controller.InformerFactory
informerFactory informerfactory.InformerFactory
// list of resources to ignore
ignoredResources map[schema.GroupResource]struct{}
@@ -103,7 +104,7 @@ type QuotaMonitor struct {
}
// NewMonitor creates a new instance of a QuotaMonitor
func NewMonitor(informersStarted <-chan struct{}, informerFactory controller.InformerFactory, ignoredResources map[schema.GroupResource]struct{}, resyncPeriod controller.ResyncPeriodFunc, replenishmentFunc ReplenishmentFunc, registry quota.Registry) *QuotaMonitor {
func NewMonitor(informersStarted <-chan struct{}, informerFactory informerfactory.InformerFactory, ignoredResources map[schema.GroupResource]struct{}, resyncPeriod controller.ResyncPeriodFunc, replenishmentFunc ReplenishmentFunc, registry quota.Registry) *QuotaMonitor {
return &QuotaMonitor{
informersStarted: informersStarted,
informerFactory: informerFactory,