Skip to content

Commit

Permalink
bug: fix a bug in multinamespaced cache implementation
Browse files Browse the repository at this point in the history
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 <varshaprasad96@gmail.com>
  • Loading branch information
varshaprasad96 authored and k8s-infra-cherrypick-robot committed Apr 24, 2023
1 parent d9f8c47 commit 57b0968
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cache/multi_namespace_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 57b0968

Please sign in to comment.