Skip to content

Commit 6d86bbb

Browse files
committed
Run separate informers for api and controllers
1 parent c52694b commit 6d86bbb

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

pkg/cmd/server/start/start_master.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -402,17 +402,17 @@ func (m *Master) Start() error {
402402
return fmt.Errorf("KubernetesMasterConfig is required to start this server - use of external Kubernetes is no longer supported.")
403403
}
404404

405-
// informers are shared amongst all the various components we build
406-
informers, err := NewInformers(*m.config)
407-
if err != nil {
408-
return err
409-
}
410405
// we have a strange, optional linkage from controllers to the API server regarding the plug. In the end, this should be structured
411406
// as a separate API server which can be chained as a delegate
412407
var controllerPlug plug.Plug
413408

414409
controllersEnabled := m.controllers && m.config.Controllers != configapi.ControllersDisabled
415410
if controllersEnabled {
411+
// informers are shared amongst all the various controllers we build
412+
informers, err := NewInformers(*m.config)
413+
if err != nil {
414+
return err
415+
}
416416
kubeInternal, _, err := configapi.GetInternalKubeClient(m.config.MasterClients.OpenShiftLoopbackKubeConfig, m.config.MasterClients.OpenShiftLoopbackClientConnectionOverrides)
417417
if err != nil {
418418
return err
@@ -497,6 +497,11 @@ func (m *Master) Start() error {
497497
}
498498

499499
if m.api {
500+
// informers are shared amongst all the various api components we build
501+
informers, err := NewInformers(*m.config)
502+
if err != nil {
503+
return err
504+
}
500505
openshiftConfig, err := origin.BuildMasterConfig(*m.config, informers)
501506
if err != nil {
502507
return err

0 commit comments

Comments
 (0)