Bump min watch timeout for secret & configmap manager in Kubelet

This commit is contained in:
Wojciech Tyczyński 2024-04-09 09:22:28 +02:00
parent 29e38c19b8
commit 36141fa6fb

View File

@ -224,12 +224,16 @@ func (c *objectCache) newReflectorLocked(namespace, name string) *objectCacheIte
return c.watchObject(namespace, options) return c.watchObject(namespace, options)
} }
store := c.newStore() store := c.newStore()
reflector := cache.NewNamedReflector( reflector := cache.NewReflectorWithOptions(
fmt.Sprintf("object-%q/%q", namespace, name),
&cache.ListWatch{ListFunc: listFunc, WatchFunc: watchFunc}, &cache.ListWatch{ListFunc: listFunc, WatchFunc: watchFunc},
c.newObject(), c.newObject(),
store, store,
0, cache.ReflectorOptions{
Name: fmt.Sprintf("object-%q/%q", namespace, name),
// Bump default 5m MinWatchTimeout to avoid recreating
// watches too often.
MinWatchTimeout: 30 * time.Minute,
},
) )
item := &objectCacheItem{ item := &objectCacheItem{
refMap: make(map[types.UID]int), refMap: make(map[types.UID]int),