mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
start informers as a post-start-hook
This commit is contained in:
parent
0afdcfcaf6
commit
5b08029e79
@ -106,8 +106,11 @@ func RunServer(config *master.Config, sharedInformers informers.SharedInformerFa
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
m.GenericAPIServer.AddPostStartHook("start-kube-apiserver-informers", func(context genericapiserver.PostStartHookContext) error {
|
||||||
|
sharedInformers.Start(stopCh)
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
|
||||||
sharedInformers.Start(stopCh)
|
|
||||||
return m.GenericAPIServer.PrepareRun().Run(stopCh)
|
return m.GenericAPIServer.PrepareRun().Run(stopCh)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ func (c completedConfig) New(stopCh <-chan struct{}) (*APIAggregator, error) {
|
|||||||
|
|
||||||
apiserviceRegistrationController := NewAPIServiceRegistrationController(informerFactory.Apiregistration().InternalVersion().APIServices(), s)
|
apiserviceRegistrationController := NewAPIServiceRegistrationController(informerFactory.Apiregistration().InternalVersion().APIServices(), s)
|
||||||
|
|
||||||
s.GenericAPIServer.AddPostStartHook("start-informers", func(context genericapiserver.PostStartHookContext) error {
|
s.GenericAPIServer.AddPostStartHook("start-kube-aggregator-informers", func(context genericapiserver.PostStartHookContext) error {
|
||||||
informerFactory.Start(stopCh)
|
informerFactory.Start(stopCh)
|
||||||
kubeInformers.Start(stopCh)
|
kubeInformers.Start(stopCh)
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user