mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-23 12:07:05 +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,34 @@ type ServiceAccountInformer interface {
|
||||
}
|
||||
|
||||
type serviceAccountInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewServiceAccountInformer constructs a new informer for ServiceAccount 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 NewServiceAccountInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredServiceAccountInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredServiceAccountInformer constructs a new informer for ServiceAccount 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 NewFilteredServiceAccountInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.CoreV1().ServiceAccounts(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.CoreV1().ServiceAccounts(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
@@ -60,12 +75,12 @@ func NewServiceAccountInformer(client kubernetes.Interface, namespace string, re
|
||||
)
|
||||
}
|
||||
|
||||
func defaultServiceAccountInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewServiceAccountInformer(client, meta_v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
func (f *serviceAccountInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredServiceAccountInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *serviceAccountInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&core_v1.ServiceAccount{}, defaultServiceAccountInformer)
|
||||
return f.factory.InformerFor(&core_v1.ServiceAccount{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *serviceAccountInformer) Lister() v1.ServiceAccountLister {
|
||||
|
Reference in New Issue
Block a user