apiextensions: fix panix with KUBE_API_VERSIONS set

pull/6/head
Dr. Stefan Schimanski 2017-08-03 16:46:05 +02:00
parent 2bd0b3dd26
commit 39316dfe9c
1 changed files with 5 additions and 5 deletions

View File

@ -178,6 +178,11 @@ func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget)
s.GenericAPIServer.Handler.NonGoRestfulMux.Handle("/apis", crdHandler)
s.GenericAPIServer.Handler.NonGoRestfulMux.HandlePrefix("/apis/", crdHandler)
// this only happens when KUBE_API_VERSIONS is set. We must return without adding controllers or poststarthooks which would affect healthz
if crdClient == nil {
return s, nil
}
crdController := NewDiscoveryController(s.Informers.Apiextensions().InternalVersion().CustomResourceDefinitions(), versionDiscoveryHandler, groupDiscoveryHandler, c.GenericConfig.RequestContextMapper)
namingController := status.NewNamingConditionController(s.Informers.Apiextensions().InternalVersion().CustomResourceDefinitions(), crdClient)
finalizingController := finalizer.NewCRDFinalizer(
@ -186,11 +191,6 @@ func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget)
crdHandler,
)
// this only happens when KUBE_API_VERSIONS is set. We must return without adding poststarthooks which would affect healthz
if crdClient == nil {
return s, nil
}
s.GenericAPIServer.AddPostStartHook("start-apiextensions-informers", func(context genericapiserver.PostStartHookContext) error {
s.Informers.Start(context.StopCh)
return nil