Skip to content

Commit

Permalink
Add a read lock before getting cache settings
Browse files Browse the repository at this point in the history
Signed-off-by: jannfis <jann@mistrust.net>
  • Loading branch information
jannfis committed Jul 6, 2022
1 parent 2aa1ce8 commit 2df1fc9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions controller/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,9 @@ func (c *liveStateCache) getCluster(server string) (clustercache.ClusterCache, e
clustercache.SetPopulateResourceInfoHandler(func(un *unstructured.Unstructured, isRoot bool) (interface{}, bool) {
res := &ResourceInfo{}
populateNodeInfo(un, res)
c.lock.RLock()
cacheSettings := c.cacheSettings
c.lock.RUnlock()
res.Health, _ = health.GetResourceHealth(un, cacheSettings.clusterSettings.ResourceHealthOverride)

appName := c.resourceTracking.GetAppName(un, cacheSettings.appInstanceLabelKey, cacheSettings.trackingMethod)
Expand Down

0 comments on commit 2df1fc9

Please sign in to comment.