From 7f4dae86e23115a7a05704afee45d4d15c3dc4f9 Mon Sep 17 00:00:00 2001 From: luhualin Date: Thu, 21 Feb 2019 19:33:04 +0800 Subject: [PATCH] fix dynamic informer tweakListOptions Kubernetes-commit: 94b0bd897d04e1668d96db8d9b5e353b15f2f2da --- dynamic/dynamicinformer/informer.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dynamic/dynamicinformer/informer.go b/dynamic/dynamicinformer/informer.go index 88a2e500..cd7c60ab 100644 --- a/dynamic/dynamicinformer/informer.go +++ b/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