Skip to content

Commit

Permalink
🐛 filter global namespace while looking for cluster scoped resources
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
varshaprasad96 committed May 8, 2021
1 parent 745c7c9 commit acb67ae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/cache/multi_namespace_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ func (c *multiNamespaceCache) List(ctx context.Context, list client.ObjectList,
limitSet := listOpts.Limit > 0

var resourceVersion string
for _, cache := range c.namespaceToCache {
for ns, cache := range c.namespaceToCache {
if ns == globalCache {
continue
}
listObj := list.DeepCopyObject().(client.ObjectList)
err = cache.List(ctx, listObj, &listOpts)
if err != nil {
Expand Down

0 comments on commit acb67ae

Please sign in to comment.