mirror of
https://github.com/kubernetes/client-go.git
synced 2025-07-18 17:21:23 +00:00
Merge pull request #118235 from kkkkun/set_watchlist_env
Lookup ENABLE_CLIENT_GO_WATCH_LIST_ALPHA in NewReflectorWithOptions Kubernetes-commit: 6911d3b2b8a498c570d58827277347b2bb8c4100
This commit is contained in:
commit
151a5919db
4
tools/cache/controller.go
vendored
4
tools/cache/controller.go
vendored
@ -18,7 +18,6 @@ package cache
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"os"
|
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -148,9 +147,6 @@ 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
|
||||||
|
5
tools/cache/reflector.go
vendored
5
tools/cache/reflector.go
vendored
@ -22,6 +22,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
@ -239,6 +240,10 @@ func NewReflectorWithOptions(lw ListerWatcher, expectedType interface{}, store S
|
|||||||
r.expectedGVK = getExpectedGVKFromObject(expectedType)
|
r.expectedGVK = getExpectedGVKFromObject(expectedType)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if s := os.Getenv("ENABLE_CLIENT_GO_WATCH_LIST_ALPHA"); len(s) > 0 {
|
||||||
|
r.UseWatchList = true
|
||||||
|
}
|
||||||
|
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user