From 74d226ccf04f529e470900e7a268528ed82ef23c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Mon, 5 Aug 2024 16:44:43 +0200 Subject: [PATCH] chore: Replace NewReflector with NewReflectorWithOptions func --- internal/store/builder.go | 2 +- tests/lib/lib_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/store/builder.go b/internal/store/builder.go index 5c38857d7b..db4e06baa9 100644 --- a/internal/store/builder.go +++ b/internal/store/builder.go @@ -603,7 +603,7 @@ func (b *Builder) startReflector( useAPIServerCache bool, ) { instrumentedListWatch := watch.NewInstrumentedListerWatcher(listWatcher, b.listWatchMetrics, reflect.TypeOf(expectedType).String(), useAPIServerCache) - reflector := cache.NewReflector(sharding.NewShardedListWatch(b.shard, b.totalShards, instrumentedListWatch), expectedType, store, 0) + reflector := cache.NewReflectorWithOptions(sharding.NewShardedListWatch(b.shard, b.totalShards, instrumentedListWatch), expectedType, store, cache.ReflectorOptions{ResyncPeriod: 0}) go reflector.Run(b.ctx.Done()) } diff --git a/tests/lib/lib_test.go b/tests/lib/lib_test.go index ba96edf00e..25c0cd426a 100644 --- a/tests/lib/lib_test.go +++ b/tests/lib/lib_test.go @@ -79,7 +79,7 @@ func serviceCollector(kubeClient clientset.Interface) *metricsstore.MetricsStore }, } - r := cache.NewReflector(&lw, &v1.Service{}, store, 0) + r := cache.NewReflectorWithOptions(&lw, &v1.Service{}, store, cache.ReflectorOptions{ResyncPeriod: 0}) go r.Run(context.TODO().Done())