Skip to content

Commit

Permalink
fix: remove lock acquisition in ClusterCache.GetAPIResources() (#543)
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Suen <[email protected]>
  • Loading branch information
jessesuen authored Oct 12, 2023
1 parent a00ce82 commit 9a03edb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/cache/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,11 @@ func (c *clusterCache) GetServerVersion() string {
}

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

return c.apiResources
}

Expand Down

0 comments on commit 9a03edb

Please sign in to comment.