From a52faa789270fc7ad1203ba1b7900ec9c0333609 Mon Sep 17 00:00:00 2001 From: Maciej Borsz Date: Mon, 31 Aug 2020 12:52:45 +0200 Subject: [PATCH] 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 --- tools/cache/controller.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/cache/controller.go b/tools/cache/controller.go index 3ad9b53b..684d1a8d 100644 --- a/tools/cache/controller.go +++ b/tools/cache/controller.go @@ -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