mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-17 07:38:22 +00:00
client-go: allow adding indexes after informer starts
Kubernetes-commit: d96a9858d396d7f418d24ea47bdc92ef8429f707
This commit is contained in:
committed by
Kubernetes Publisher
parent
84a6fe7e40
commit
785e19661f
4
tools/cache/shared_informer.go
vendored
4
tools/cache/shared_informer.go
vendored
@@ -540,8 +540,8 @@ func (s *sharedIndexInformer) AddIndexers(indexers Indexers) error {
|
||||
s.startedLock.Lock()
|
||||
defer s.startedLock.Unlock()
|
||||
|
||||
if s.started {
|
||||
return fmt.Errorf("informer has already started")
|
||||
if s.stopped {
|
||||
return fmt.Errorf("indexer was not added because it has stopped already")
|
||||
}
|
||||
|
||||
return s.indexer.AddIndexers(indexers)
|
||||
|
Reference in New Issue
Block a user