From fc9db3ad1a51e5f751ce590a31509afdde8b81c1 Mon Sep 17 00:00:00 2001 From: FillZpp Date: Thu, 21 Oct 2021 15:49:54 +0800 Subject: [PATCH] Fix the internal cache object selector Signed-off-by: FillZpp --- pkg/cache/cache.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/cache/cache.go b/pkg/cache/cache.go index f89800ca2f..f08983335d 100644 --- a/pkg/cache/cache.go +++ b/pkg/cache/cache.go @@ -86,8 +86,11 @@ type Informer interface { HasSynced() bool } +// ObjectSelector is an alias name of internal.Selector. +type ObjectSelector internal.Selector + // SelectorsByObject associate a client.Object's GVK to a field/label selector. -type SelectorsByObject map[client.Object]internal.Selector +type SelectorsByObject map[client.Object]ObjectSelector // Options are the optional arguments for creating a new InformersMap object. type Options struct { @@ -198,7 +201,7 @@ func convertToSelectorsByGVK(selectorsByObject SelectorsByObject, scheme *runtim if err != nil { return nil, err } - selectorsByGVK[gvk] = selector + selectorsByGVK[gvk] = internal.Selector(selector) } return selectorsByGVK, nil }