Skip to content

Commit

Permalink
Use read mutex when iterating over informers map
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelSpeed committed Sep 25, 2018
1 parent d2963e0 commit ef53383
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 ef53383

Please sign in to comment.