mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
cache/controller: Add ENABLE_CLIENT_GO_WATCH_LIST_ALPHA
This commit is contained in:
parent
194ffd779e
commit
966b26d55c
@ -415,6 +415,9 @@ func NewCacherFromConfig(config Config) (*Cacher, error) {
|
|||||||
// We don't want to terminate all watchers as recreating all watchers puts high load on api-server.
|
// We don't want to terminate all watchers as recreating all watchers puts high load on api-server.
|
||||||
// In most of the cases, leader is reelected within few cycles.
|
// In most of the cases, leader is reelected within few cycles.
|
||||||
reflector.MaxInternalErrorRetryDuration = time.Second * 30
|
reflector.MaxInternalErrorRetryDuration = time.Second * 30
|
||||||
|
// since the watch-list is provided by the watch cache instruct
|
||||||
|
// the reflector to issue a regular LIST against the store
|
||||||
|
reflector.UseWatchList = false
|
||||||
|
|
||||||
cacher.watchCache = watchCache
|
cacher.watchCache = watchCache
|
||||||
cacher.reflector = reflector
|
cacher.reflector = reflector
|
||||||
|
@ -18,6 +18,7 @@ package cache
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -147,6 +148,9 @@ func (c *controller) Run(stopCh <-chan struct{}) {
|
|||||||
if c.config.WatchErrorHandler != nil {
|
if c.config.WatchErrorHandler != nil {
|
||||||
r.watchErrorHandler = c.config.WatchErrorHandler
|
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.reflectorMutex.Lock()
|
||||||
c.reflector = r
|
c.reflector = r
|
||||||
|
Loading…
Reference in New Issue
Block a user