From 36141fa6fb66dedce4873df45db0c7daecb3ba52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Tyczy=C5=84ski?= Date: Tue, 9 Apr 2024 09:22:28 +0200 Subject: [PATCH] Bump min watch timeout for secret & configmap manager in Kubelet --- pkg/kubelet/util/manager/watch_based_manager.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/kubelet/util/manager/watch_based_manager.go b/pkg/kubelet/util/manager/watch_based_manager.go index f04891fce53..91c79176472 100644 --- a/pkg/kubelet/util/manager/watch_based_manager.go +++ b/pkg/kubelet/util/manager/watch_based_manager.go @@ -224,12 +224,16 @@ func (c *objectCache) newReflectorLocked(namespace, name string) *objectCacheIte return c.watchObject(namespace, options) } store := c.newStore() - reflector := cache.NewNamedReflector( - fmt.Sprintf("object-%q/%q", namespace, name), + reflector := cache.NewReflectorWithOptions( &cache.ListWatch{ListFunc: listFunc, WatchFunc: watchFunc}, c.newObject(), 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{ refMap: make(map[types.UID]int),