cache/controller: Add ENABLE_CLIENT_GO_WATCH_LIST_ALPHA

Kubernetes-commit: 966b26d55c22f7fbf20841a3a993de4f984d88db
This commit is contained in:
Lukasz Szaszkiewicz 2023-03-07 12:34:11 +01:00 committed by Kubernetes Publisher
parent ac0a428e7a
commit 262b98af03

View File

@ -18,6 +18,7 @@ package cache
import (
"errors"
"os"
"sync"
"time"
@ -147,6 +148,9 @@ func (c *controller) Run(stopCh <-chan struct{}) {
if c.config.WatchErrorHandler != nil {
r.watchErrorHandler = c.config.WatchErrorHandler
}
if s := os.Getenv("ENABLE_CLIENT_GO_WATCH_LIST_ALPHA"); len(s) > 0 {
r.UseWatchList = true
}
c.reflectorMutex.Lock()
c.reflector = r