Skip to content

Commit 9a03edb

Browse files
authored
fix: remove lock acquisition in ClusterCache.GetAPIResources() (#543)
Signed-off-by: Jesse Suen <[email protected]>
1 parent a00ce82 commit 9a03edb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/cache/cluster.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,11 @@ func (c *clusterCache) GetServerVersion() string {
300300
}
301301

302302
// GetAPIResources returns information about observed API resources
303+
// This method is called frequently during reconciliation to pass API resource info to `helm template`
304+
// NOTE: we do not provide any consistency guarantees about the returned list. The list might be
305+
// updated in place (anytime new CRDs are introduced or removed). If necessary, a separate method
306+
// would need to be introduced to return a copy of the list so it can be iterated consistently.
303307
func (c *clusterCache) GetAPIResources() []kube.APIResourceInfo {
304-
c.lock.RLock()
305-
defer c.lock.RUnlock()
306-
307308
return c.apiResources
308309
}
309310

0 commit comments

Comments
 (0)