apiserver: sync with https server shutdown to flush existing connections

This commit is contained in:
Dr. Stefan Schimanski
2019-01-16 15:58:53 +01:00
parent 8743a0e3c6
commit 5b47f99164
7 changed files with 34 additions and 19 deletions

View File

@@ -214,7 +214,8 @@ func Run(cc schedulerserverconfig.CompletedConfig, stopCh <-chan struct{}) error
}
if cc.SecureServing != nil {
handler := buildHandlerChain(newHealthzHandler(&cc.ComponentConfig, false, checks...), cc.Authentication.Authenticator, cc.Authorization.Authorizer)
if err := cc.SecureServing.Serve(handler, 0, stopCh); err != nil {
// TODO: handle stoppedCh returned by c.SecureServing.Serve
if _, err := cc.SecureServing.Serve(handler, 0, stopCh); err != nil {
// fail early for secure handlers, removing the old error loop from above
return fmt.Errorf("failed to start healthz server: %v", err)
}