mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-09 10:59:57 +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 storageClassInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newStorageClassInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewStorageClassInformer constructs a new informer for StorageClass 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 NewStorageClassInformer(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.StorageV1beta1().StorageClasses().List(options)
|
||||
@@ -53,14 +56,16 @@ func newStorageClassInformer(client kubernetes.Interface, resyncPeriod time.Dura
|
||||
},
|
||||
&storage_v1beta1.StorageClass{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultStorageClassInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewStorageClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *storageClassInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&storage_v1beta1.StorageClass{}, newStorageClassInformer)
|
||||
return f.factory.InformerFor(&storage_v1beta1.StorageClass{}, defaultStorageClassInformer)
|
||||
}
|
||||
|
||||
func (f *storageClassInformer) Lister() v1beta1.StorageClassLister {
|
||||
|
Reference in New Issue
Block a user