Merge pull request #72970 from sttts/sttts-wait-for-http-server-finished-shutdown

apiserver: sync with http server shutdown to flush existing connections
This commit is contained in:
Kubernetes Prow Robot
2019-01-18 03:06:36 -08:00
committed by GitHub
7 changed files with 34 additions and 19 deletions

View File

@@ -208,7 +208,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)
}