From 94b0bd897d04e1668d96db8d9b5e353b15f2f2da Mon Sep 17 00:00:00 2001 From: luhualin Date: Thu, 21 Feb 2019 19:33:04 +0800 Subject: [PATCH] fix dynamic informer tweakListOptions --- .../src/k8s.io/client-go/dynamic/dynamicinformer/informer.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/staging/src/k8s.io/client-go/dynamic/dynamicinformer/informer.go b/staging/src/k8s.io/client-go/dynamic/dynamicinformer/informer.go index 88a2e500c04..cd7c60ab220 100644 --- a/staging/src/k8s.io/client-go/dynamic/dynamicinformer/informer.go +++ b/staging/src/k8s.io/client-go/dynamic/dynamicinformer/informer.go @@ -45,6 +45,7 @@ func NewFilteredDynamicSharedInformerFactory(client dynamic.Interface, defaultRe namespace: metav1.NamespaceAll, informers: map[schema.GroupVersionResource]informers.GenericInformer{}, startedInformers: make(map[schema.GroupVersionResource]bool), + tweakListOptions: tweakListOptions, } } @@ -58,6 +59,7 @@ type dynamicSharedInformerFactory struct { // startedInformers is used for tracking which informers have been started. // This allows Start() to be called multiple times safely. startedInformers map[schema.GroupVersionResource]bool + tweakListOptions TweakListOptionsFunc } var _ DynamicSharedInformerFactory = &dynamicSharedInformerFactory{} @@ -72,7 +74,7 @@ func (f *dynamicSharedInformerFactory) ForResource(gvr schema.GroupVersionResour return informer } - informer = NewFilteredDynamicInformer(f.client, gvr, f.namespace, f.defaultResync, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, nil) + informer = NewFilteredDynamicInformer(f.client, gvr, f.namespace, f.defaultResync, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) f.informers[key] = informer return informer