Skip to content

Commit ef53383

Browse files
committed
Use read mutex when iterating over informers map
1 parent d2963e0 commit ef53383

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/cache/internal/informers_map.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ func (ip *specificInformersMap) Start(stop <-chan struct{}) {
127127

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

0 commit comments

Comments
 (0)