log preshutdowndown registration error if we encounter one

Kubernetes-commit: 021f6082944496765383c7572157e9be86ed4177
This commit is contained in:
Han Kang 2019-03-26 13:04:10 -07:00 committed by Kubernetes Publisher
parent 53a7466644
commit 18a2d0a0ba
1 changed files with 4 additions and 1 deletions

View File

@ -258,10 +258,13 @@ func (s *GenericAPIServer) PrepareRun() preparedGenericAPIServer {
// Register audit backend preShutdownHook.
if s.AuditBackend != nil {
s.AddPreShutdownHook("audit-backend", func() error {
err := s.AddPreShutdownHook("audit-backend", func() error {
s.AuditBackend.Shutdown()
return nil
})
if err != nil {
klog.Errorf("Failed to add pre-shutdown hook for audit-backend %s", err)
}
}
return preparedGenericAPIServer{s}