mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-28 16:06:49 +00:00
Re-generate informers
Kubernetes-commit: 37f909a274df25e2574cbc6a92f7a9991d1948ce
This commit is contained in:
committed by
Kubernetes Publisher
parent
a2643f9d58
commit
953296ece8
@@ -41,8 +41,11 @@ type priorityClassInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newPriorityClassInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewPriorityClassInformer constructs a new informer for PriorityClass type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewPriorityClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.SchedulingV1alpha1().PriorityClasses().List(options)
|
||||
@@ -53,14 +56,16 @@ func newPriorityClassInformer(client kubernetes.Interface, resyncPeriod time.Dur
|
||||
},
|
||||
&scheduling_v1alpha1.PriorityClass{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultPriorityClassInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewPriorityClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *priorityClassInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&scheduling_v1alpha1.PriorityClass{}, newPriorityClassInformer)
|
||||
return f.factory.InformerFor(&scheduling_v1alpha1.PriorityClass{}, defaultPriorityClassInformer)
|
||||
}
|
||||
|
||||
func (f *priorityClassInformer) Lister() v1alpha1.PriorityClassLister {
|
||||
|
Reference in New Issue
Block a user