Skip to content

Commit

Permalink
Merge pull request #2465 from mrueg/newreflectorwithoptions
Browse files Browse the repository at this point in the history
chore: Replace NewReflector with NewReflectorWithOptions func
  • Loading branch information
k8s-ci-robot authored Aug 5, 2024
2 parents 5878458 + 74d226c commit 45b5a26
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/store/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

Expand Down
2 changes: 1 addition & 1 deletion tests/lib/lib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down

0 comments on commit 45b5a26

Please sign in to comment.