Skip to content

Commit 03d09f6

Browse files
varshaprasad96alebedev87
authored andcommitted
🐛 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 <[email protected]>
1 parent 44c5d50 commit 03d09f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/cache/multi_namespace_cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func (c *multiNamespaceCache) WaitForCacheSync(ctx context.Context) bool {
185185
func (c *multiNamespaceCache) IndexField(ctx context.Context, obj client.Object, field string, extractValue client.IndexerFunc) error {
186186
isNamespaced, err := objectutil.IsAPINamespaced(obj, c.Scheme, c.RESTMapper)
187187
if err != nil {
188-
return nil //nolint:nilerr
188+
return err
189189
}
190190

191191
if !isNamespaced {

0 commit comments

Comments
 (0)