Skip to content

Commit

Permalink
Fix data race around static secret capability manager (#28653)
Browse files Browse the repository at this point in the history
* Fix data race around static secret capability manager

* Actually, clone the map
  • Loading branch information
VioletHynes authored Oct 9, 2024
1 parent 1229f57 commit 210da8f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,10 @@ func (sscm *StaticSecretCapabilityManager) StartRenewingCapabilities(indexToRene

capabilitiesIndex.IndexLock.RLock()
token := capabilitiesIndex.Token
indexReadablePathsMap := capabilitiesIndex.ReadablePaths
indexReadablePathsMap := map[string]struct{}{}
maps.Copy(indexReadablePathsMap, capabilitiesIndex.ReadablePaths)
capabilitiesIndex.IndexLock.RUnlock()

indexReadablePaths := maps.Keys(indexReadablePathsMap)

client, err := sscm.client.Clone()
Expand Down

0 comments on commit 210da8f

Please sign in to comment.