Skip to content

Commit

Permalink
Merge pull request #160 from pusher/fix-race
Browse files Browse the repository at this point in the history
Use read mutex when iterating over informers map
  • Loading branch information
k8s-ci-robot committed Sep 25, 2018
2 parents d2963e0 + ef53383 commit b2824f6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/cache/internal/informers_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ func (ip *specificInformersMap) Start(stop <-chan struct{}) {

// HasSyncedFuncs returns all the HasSynced functions for the informers in this map.
func (ip *specificInformersMap) HasSyncedFuncs() []cache.InformerSynced {
ip.mu.RLock()
defer ip.mu.RUnlock()
syncedFuncs := make([]cache.InformerSynced, 0, len(ip.informersByGVK))
for _, informer := range ip.informersByGVK {
syncedFuncs = append(syncedFuncs, informer.Informer.HasSynced)
Expand Down

0 comments on commit b2824f6

Please sign in to comment.