From 57b0968cccafe01f5bc379296216624829a71e94 Mon Sep 17 00:00:00 2001 From: Varsha Prasad Narsing Date: Mon, 27 Mar 2023 17:57:14 -0400 Subject: [PATCH] bug: fix a bug in multinamespaced cache implementation This commit fixes a bug that was brought in long ago in #1520. When the object's scope is not deterministic from the RESTMapper it should return an error instead of ignoring it. Signed-off-by: Varsha Prasad Narsing --- pkg/cache/multi_namespace_cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cache/multi_namespace_cache.go b/pkg/cache/multi_namespace_cache.go index fccb364710..cbf1b038ec 100644 --- a/pkg/cache/multi_namespace_cache.go +++ b/pkg/cache/multi_namespace_cache.go @@ -185,7 +185,7 @@ func (c *multiNamespaceCache) WaitForCacheSync(ctx context.Context) bool { func (c *multiNamespaceCache) IndexField(ctx context.Context, obj client.Object, field string, extractValue client.IndexerFunc) error { isNamespaced, err := objectutil.IsAPINamespaced(obj, c.Scheme, c.RESTMapper) if err != nil { - return nil //nolint:nilerr + return err } if !isNamespaced {