Skip to content

Commit 9fd8151

Browse files
committed
remove clustername from cachekey
1 parent dbefa63 commit 9fd8151

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/cache/internal/cache_reader.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func (c *CacheReader) Get(_ context.Context, key client.ObjectKey, out client.Ob
6161
if c.scopeName == apimeta.RESTScopeNameRoot {
6262
key.Namespace = ""
6363
}
64-
storeKey := objectKeyToStoreKey(key, out.GetClusterName())
64+
storeKey := objectKeyToStoreKey(key)
6565
fmt.Println("storeKey", storeKey)
6666

6767
// Lookup the object from the indexer cache
@@ -184,11 +184,11 @@ func (c *CacheReader) List(_ context.Context, out client.ObjectList, opts ...cli
184184
// It's akin to MetaNamespaceKeyFunc. It's separate from
185185
// String to allow keeping the key format easily in sync with
186186
// MetaNamespaceKeyFunc.
187-
func objectKeyToStoreKey(k client.ObjectKey, clusterName string) string {
187+
func objectKeyToStoreKey(k client.ObjectKey) string {
188188
if k.Namespace == "" {
189-
return k.Name + clusterName
189+
return k.Name
190190
}
191-
return k.Namespace + "/" + k.Name + "/" + clusterName
191+
return k.Namespace + "/" + k.Name
192192
}
193193

194194
// requiresExactMatch checks if the given field selector is of the form `k=v` or `k==v`.

0 commit comments

Comments
 (0)