mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-24 12:38:14 +00:00
Re-generate informers
Kubernetes-commit: 37f909a274df25e2574cbc6a92f7a9991d1948ce
This commit is contained in:
committed by
Kubernetes Publisher
parent
a2643f9d58
commit
953296ece8
@@ -41,26 +41,31 @@ type ingressInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newIngressInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewIngressInformer constructs a new informer for Ingress 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 NewIngressInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.ExtensionsV1beta1().Ingresses(v1.NamespaceAll).List(options)
|
||||
return client.ExtensionsV1beta1().Ingresses(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.ExtensionsV1beta1().Ingresses(v1.NamespaceAll).Watch(options)
|
||||
return client.ExtensionsV1beta1().Ingresses(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&extensions_v1beta1.Ingress{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultIngressInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewIngressInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *ingressInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&extensions_v1beta1.Ingress{}, newIngressInformer)
|
||||
return f.factory.InformerFor(&extensions_v1beta1.Ingress{}, defaultIngressInformer)
|
||||
}
|
||||
|
||||
func (f *ingressInformer) Lister() v1beta1.IngressLister {
|
||||
|
Reference in New Issue
Block a user