diff --git a/pkg/cache/internal/informers.go b/pkg/cache/internal/informers.go index c270e809ca..62b7244210 100644 --- a/pkg/cache/internal/informers.go +++ b/pkg/cache/internal/informers.go @@ -18,6 +18,7 @@ package internal import ( "context" + "errors" "fmt" "math/rand" "net/http" @@ -186,6 +187,12 @@ type Informers struct { // Start calls Run on each of the informers and sets started to true. Blocks on the context. // It doesn't return start because it can't return an error, and it's not a runnable directly. func (ip *Informers) Start(ctx context.Context) error { + select { + case <-ip.startWait: + return errors.New("Informrmer already started") + default: + // do nothing + } func() { ip.mu.Lock() defer ip.mu.Unlock()