Shared Informer Run blocks until all goroutines finish

Fixes #45454
This commit is contained in:
Mikhail Mazurskiy
2017-05-27 23:34:58 +10:00
parent e09a353942
commit d789615902
9 changed files with 51 additions and 41 deletions

View File

@@ -51,7 +51,7 @@ func NewPodStore(c clientset.Interface, namespace string, label labels.Selector,
store := cache.NewStore(cache.MetaNamespaceKeyFunc)
stopCh := make(chan struct{})
reflector := cache.NewReflector(lw, &v1.Pod{}, store, 0)
reflector.RunUntil(stopCh)
go reflector.Run(stopCh)
return &PodStore{Store: store, stopCh: stopCh, Reflector: reflector}
}