mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-09 19:09:30 +00:00
run hack/update-codegen.sh
Kubernetes-commit: 6a4b80fcabc5e950af997d97f447354b83fcdcc4
This commit is contained in:
committed by
Kubernetes Publisher
parent
d017730688
commit
a6812b3f80
@@ -38,19 +38,33 @@ type StorageClassInformer interface {
|
||||
}
|
||||
|
||||
type storageClassInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// 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 NewFilteredStorageClassInformer(client, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredStorageClassInformer 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 NewFilteredStorageClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.StorageV1beta1().StorageClasses().List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.StorageV1beta1().StorageClasses().Watch(options)
|
||||
},
|
||||
},
|
||||
@@ -60,12 +74,12 @@ func NewStorageClassInformer(client kubernetes.Interface, resyncPeriod time.Dura
|
||||
)
|
||||
}
|
||||
|
||||
func defaultStorageClassInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewStorageClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
func (f *storageClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredStorageClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *storageClassInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&storage_v1beta1.StorageClass{}, defaultStorageClassInformer)
|
||||
return f.factory.InformerFor(&storage_v1beta1.StorageClass{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *storageClassInformer) Lister() v1beta1.StorageClassLister {
|
||||
|
Reference in New Issue
Block a user