Merge pull request #74344 from Betula-L/fix-dynamic-informer

fix dynamic informer mishandles parameter tweakListOptions

Kubernetes-commit: 601c2d85500ec9fee9bd3c941f40c4d5e705474b
This commit is contained in:
Kubernetes Publisher 2019-02-27 04:33:52 -08:00
commit 24814d20da
2 changed files with 55 additions and 53 deletions

104
Godeps/Godeps.json generated
View File

@ -1,7 +1,7 @@
{ {
"ImportPath": "k8s.io/client-go", "ImportPath": "k8s.io/client-go",
"GoVersion": "go1.11", "GoVersion": "go1.11",
"GodepVersion": "v80-k8s-r1", "GodepVersion": "v80",
"Packages": [ "Packages": [
"./..." "./..."
], ],
@ -412,207 +412,207 @@
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting", "ImportPath": "k8s.io/apimachinery/pkg/api/apitesting",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/fuzzer", "ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/fuzzer",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/roundtrip", "ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/roundtrip",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/equality", "ImportPath": "k8s.io/apimachinery/pkg/api/equality",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/errors", "ImportPath": "k8s.io/apimachinery/pkg/api/errors",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/meta", "ImportPath": "k8s.io/apimachinery/pkg/api/meta",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/resource", "ImportPath": "k8s.io/apimachinery/pkg/api/resource",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion", "ImportPath": "k8s.io/apimachinery/pkg/conversion",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/fields", "ImportPath": "k8s.io/apimachinery/pkg/fields",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/labels", "ImportPath": "k8s.io/apimachinery/pkg/labels",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime", "ImportPath": "k8s.io/apimachinery/pkg/runtime",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/selection", "ImportPath": "k8s.io/apimachinery/pkg/selection",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/types", "ImportPath": "k8s.io/apimachinery/pkg/types",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/cache", "ImportPath": "k8s.io/apimachinery/pkg/util/cache",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/clock", "ImportPath": "k8s.io/apimachinery/pkg/util/clock",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/diff", "ImportPath": "k8s.io/apimachinery/pkg/util/diff",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/errors", "ImportPath": "k8s.io/apimachinery/pkg/util/errors",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/framer", "ImportPath": "k8s.io/apimachinery/pkg/util/framer",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream", "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy", "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr", "ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/json", "ImportPath": "k8s.io/apimachinery/pkg/util/json",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch", "ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/naming", "ImportPath": "k8s.io/apimachinery/pkg/util/naming",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/net", "ImportPath": "k8s.io/apimachinery/pkg/util/net",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand", "ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime", "ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/sets", "ImportPath": "k8s.io/apimachinery/pkg/util/sets",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch", "ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/validation", "ImportPath": "k8s.io/apimachinery/pkg/util/validation",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/wait", "ImportPath": "k8s.io/apimachinery/pkg/util/wait",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml", "ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/version", "ImportPath": "k8s.io/apimachinery/pkg/version",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/watch", "ImportPath": "k8s.io/apimachinery/pkg/watch",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
"Rev": "33f4ffca8693764f1a472b759ebd335e9b756e5b" "Rev": "dcb391cde5ca0298013d43336817d20b74650702"
}, },
{ {
"ImportPath": "k8s.io/klog", "ImportPath": "k8s.io/klog",

View File

@ -45,6 +45,7 @@ func NewFilteredDynamicSharedInformerFactory(client dynamic.Interface, defaultRe
namespace: metav1.NamespaceAll, namespace: metav1.NamespaceAll,
informers: map[schema.GroupVersionResource]informers.GenericInformer{}, informers: map[schema.GroupVersionResource]informers.GenericInformer{},
startedInformers: make(map[schema.GroupVersionResource]bool), 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. // startedInformers is used for tracking which informers have been started.
// This allows Start() to be called multiple times safely. // This allows Start() to be called multiple times safely.
startedInformers map[schema.GroupVersionResource]bool startedInformers map[schema.GroupVersionResource]bool
tweakListOptions TweakListOptionsFunc
} }
var _ DynamicSharedInformerFactory = &dynamicSharedInformerFactory{} var _ DynamicSharedInformerFactory = &dynamicSharedInformerFactory{}
@ -72,7 +74,7 @@ func (f *dynamicSharedInformerFactory) ForResource(gvr schema.GroupVersionResour
return informer 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 f.informers[key] = informer
return informer return informer