Skip to content

Commit 45b5a26

Browse files
authored
Merge pull request #2465 from mrueg/newreflectorwithoptions
chore: Replace NewReflector with NewReflectorWithOptions func
2 parents 5878458 + 74d226c commit 45b5a26

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/store/builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ func (b *Builder) startReflector(
603603
useAPIServerCache bool,
604604
) {
605605
instrumentedListWatch := watch.NewInstrumentedListerWatcher(listWatcher, b.listWatchMetrics, reflect.TypeOf(expectedType).String(), useAPIServerCache)
606-
reflector := cache.NewReflector(sharding.NewShardedListWatch(b.shard, b.totalShards, instrumentedListWatch), expectedType, store, 0)
606+
reflector := cache.NewReflectorWithOptions(sharding.NewShardedListWatch(b.shard, b.totalShards, instrumentedListWatch), expectedType, store, cache.ReflectorOptions{ResyncPeriod: 0})
607607
go reflector.Run(b.ctx.Done())
608608
}
609609

tests/lib/lib_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func serviceCollector(kubeClient clientset.Interface) *metricsstore.MetricsStore
7979
},
8080
}
8181

82-
r := cache.NewReflector(&lw, &v1.Service{}, store, 0)
82+
r := cache.NewReflectorWithOptions(&lw, &v1.Service{}, store, cache.ReflectorOptions{ResyncPeriod: 0})
8383

8484
go r.Run(context.TODO().Done())
8585

0 commit comments

Comments
 (0)