Log the error even if closeFn crashes

This commit is contained in:
Ted Yu 2019-10-21 16:41:54 -07:00
parent f0e1d394f1
commit 79dfd42718

View File

@ -190,6 +190,8 @@ func startMasterOrDie(masterConfig *master.Config, incomingServer *httptest.Serv
masterConfig.ExtraConfig.VersionedInformers = informers.NewSharedInformerFactory(clientset, masterConfig.GenericConfig.LoopbackClientConfig.Timeout)
m, err = masterConfig.Complete().New(genericapiserver.NewEmptyDelegate())
if err != nil {
// We log the error first so that even if closeFn crashes, the error is shown
klog.Errorf("error in bringing up the master: %v", err)
closeFn()
klog.Fatalf("error in bringing up the master: %v", err)
}