fix dynamic informer tweakListOptions

pull/564/head
luhualin 2019-02-21 19:33:04 +08:00
parent 59beb8c36b
commit 94b0bd897d
1 changed files with 3 additions and 1 deletions

View File

@ -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