Skip to content

Commit acb67ae

Browse files
🐛 filter global namespace while looking for cluster scoped resources
In the current implementation of multinamespaced cache, we look at global namespace while listing objects from all namespaced. Global namespace should not be looked at while fetching namespaced resources.
1 parent 745c7c9 commit acb67ae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/cache/multi_namespace_cache.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,10 @@ func (c *multiNamespaceCache) List(ctx context.Context, list client.ObjectList,
190190
limitSet := listOpts.Limit > 0
191191

192192
var resourceVersion string
193-
for _, cache := range c.namespaceToCache {
193+
for ns, cache := range c.namespaceToCache {
194+
if ns == globalCache {
195+
continue
196+
}
194197
listObj := list.DeepCopyObject().(client.ObjectList)
195198
err = cache.List(ctx, listObj, &listOpts)
196199
if err != nil {

0 commit comments

Comments
 (0)