Skip to content

Commit 601c2d8

Browse files
authored
Merge pull request kubernetes#74344 from Betula-L/fix-dynamic-informer
fix dynamic informer mishandles parameter tweakListOptions
2 parents a514fa0 + 94b0bd8 commit 601c2d8

File tree

1 file changed

+3
-1
lines changed
  • staging/src/k8s.io/client-go/dynamic/dynamicinformer

1 file changed

+3
-1
lines changed

staging/src/k8s.io/client-go/dynamic/dynamicinformer/informer.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ func NewFilteredDynamicSharedInformerFactory(client dynamic.Interface, defaultRe
4545
namespace: metav1.NamespaceAll,
4646
informers: map[schema.GroupVersionResource]informers.GenericInformer{},
4747
startedInformers: make(map[schema.GroupVersionResource]bool),
48+
tweakListOptions: tweakListOptions,
4849
}
4950
}
5051

@@ -58,6 +59,7 @@ type dynamicSharedInformerFactory struct {
5859
// startedInformers is used for tracking which informers have been started.
5960
// This allows Start() to be called multiple times safely.
6061
startedInformers map[schema.GroupVersionResource]bool
62+
tweakListOptions TweakListOptionsFunc
6163
}
6264

6365
var _ DynamicSharedInformerFactory = &dynamicSharedInformerFactory{}
@@ -72,7 +74,7 @@ func (f *dynamicSharedInformerFactory) ForResource(gvr schema.GroupVersionResour
7274
return informer
7375
}
7476

75-
informer = NewFilteredDynamicInformer(f.client, gvr, f.namespace, f.defaultResync, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, nil)
77+
informer = NewFilteredDynamicInformer(f.client, gvr, f.namespace, f.defaultResync, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
7678
f.informers[key] = informer
7779

7880
return informer

0 commit comments

Comments
 (0)