Skip to content

Commit

Permalink
Merge pull request #4825 from wangxf1987/master
Browse files Browse the repository at this point in the history
add: Use opts.ResyncPeriod as controlPlaneInformerManager and sharedF…
  • Loading branch information
karmada-bot authored Apr 25, 2024
2 parents 40d65f9 + 3232c52 commit 87c7782
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/controller-manager/app/controllermanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -735,10 +735,10 @@ func setupControllers(mgr controllerruntime.Manager, opts *options.Options, stop
return
}

controlPlaneInformerManager := genericmanager.NewSingleClusterInformerManager(dynamicClientSet, 0, stopChan)
controlPlaneInformerManager := genericmanager.NewSingleClusterInformerManager(dynamicClientSet, opts.ResyncPeriod.Duration, stopChan)
// We need a service lister to build a resource interpreter with `ClusterIPServiceResolver`
// witch allows connection to the customized interpreter webhook without a cluster DNS service.
sharedFactory := informers.NewSharedInformerFactory(kubeClientSet, 0)
sharedFactory := informers.NewSharedInformerFactory(kubeClientSet, opts.ResyncPeriod.Duration)
serviceLister := sharedFactory.Core().V1().Services().Lister()
sharedFactory.Start(stopChan)
sharedFactory.WaitForCacheSync(stopChan)
Expand Down
1 change: 1 addition & 0 deletions pkg/resourceinterpreter/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func (i *customResourceInterpreterImpl) Start(ctx context.Context) (err error) {
i.defaultInterpreter = native.NewDefaultInterpreter()

i.informer.Start()
i.informer.WaitForCacheSync()
<-ctx.Done()
klog.Infof("Stopped as stopCh closed.")
return nil
Expand Down

0 comments on commit 87c7782

Please sign in to comment.