Merge pull request #83971 from yutedz/err-start-master

Log the error before calling closeFn
This commit is contained in:
Kubernetes Prow Robot 2019-10-21 22:31:21 -07:00 committed by GitHub
commit 3ff376923d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)
}