chore: use WatchFuncWithContext (#25520)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
This commit is contained in:
Michael Crenshaw
2025-12-04 20:46:18 -05:00
committed by GitHub
parent b7c7d02b0e
commit 7cdc0f952f

View File

@@ -671,7 +671,7 @@ func (c *clusterCache) watchEvents(ctx context.Context, api kube.APIResourceInfo
}
w, err := watchutil.NewRetryWatcherWithContext(ctx, resourceVersion, &cache.ListWatch{
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) {
res, err := resClient.Watch(ctx, options)
if apierrors.IsNotFound(err) {
c.stopWatching(api.GroupKind, ns)