Add WatchListPageSize to cache.Config

Currently there is no way to specify WatchListPageSize used by Controller. This PR adds a field that can be used to specify this.

Change-Id: I241454a45dd94d3ea65a91b297f530e217f843aa

Kubernetes-commit: 43f5afe1a1dd058a2564cd3b2f330fc2a401f607
This commit is contained in:
Maciej Borsz 2020-08-31 12:52:45 +02:00 committed by Kubernetes Publisher
parent 0d9e08cf3a
commit a52faa7892

View File

@ -72,6 +72,9 @@ type Config struct {
// Called whenever the ListAndWatch drops the connection with an error.
WatchErrorHandler WatchErrorHandler
// WatchListPageSize is the requested chunk size of initial and relist watch lists.
WatchListPageSize int64
}
// ShouldResyncFunc is a type of function that indicates if a reflector should perform a
@ -134,6 +137,7 @@ func (c *controller) Run(stopCh <-chan struct{}) {
c.config.FullResyncPeriod,
)
r.ShouldResync = c.config.ShouldResync
r.WatchListPageSize = c.config.WatchListPageSize
r.clock = c.clock
if c.config.WatchErrorHandler != nil {
r.watchErrorHandler = c.config.WatchErrorHandler