mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 23:37:01 +00:00
Merge pull request #25141 from jsafrane/devel/fix-store-race
Make threadSafeMap.ListIndexFuncValues thread safe.
This commit is contained in:
commit
64e1240180
3
pkg/client/cache/thread_safe_store.go
vendored
3
pkg/client/cache/thread_safe_store.go
vendored
@ -179,6 +179,9 @@ func (c *threadSafeMap) ByIndex(indexName, indexKey string) ([]interface{}, erro
|
||||
}
|
||||
|
||||
func (c *threadSafeMap) ListIndexFuncValues(indexName string) []string {
|
||||
c.lock.RLock()
|
||||
defer c.lock.RUnlock()
|
||||
|
||||
index := c.indices[indexName]
|
||||
names := make([]string, 0, len(index))
|
||||
for key := range index {
|
||||
|
Loading…
Reference in New Issue
Block a user