mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 02:34:03 +00:00
Merge pull request #43144 from deads2k/server-06-informer-start
Automatic merge from submit-queue (batch tested with PRs 43144, 42671, 43226, 43314, 43361) start informers as a post-start-hook Switches the shared informer start to a post start hook to make future API server composition easier. PostStartHooks will have to be unioned for server composition and this ensures that we don't accidentally skip starting them.
This commit is contained in:
commit
59728a09de
@ -106,8 +106,11 @@ func RunServer(config *master.Config, sharedInformers informers.SharedInformerFa
|
||||
if err != nil {
|
||||
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)
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ func (c completedConfig) New(stopCh <-chan struct{}) (*APIAggregator, error) {
|
||||
|
||||
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)
|
||||
kubeInformers.Start(stopCh)
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user