chore: Replace NewReflector with NewReflectorWithOptions func

This commit is contained in:
Manuel Rüger 2024-08-05 16:44:43 +02:00
parent d1e717911b
commit 74d226ccf0
2 changed files with 2 additions and 2 deletions

View File

@ -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())
}

View File

@ -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())