Skip to content

Commit 4277079

Browse files
authored
Merge pull request kubernetes#75743 from logicalhan/preshutdownerror
log preshutdowndown registration error if we encounter one
2 parents 2e05cdb + 021f608 commit 4277079

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

staging/src/k8s.io/apiserver/pkg/server/genericapiserver.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,13 @@ func (s *GenericAPIServer) PrepareRun() preparedGenericAPIServer {
258258

259259
// Register audit backend preShutdownHook.
260260
if s.AuditBackend != nil {
261-
s.AddPreShutdownHook("audit-backend", func() error {
261+
err := s.AddPreShutdownHook("audit-backend", func() error {
262262
s.AuditBackend.Shutdown()
263263
return nil
264264
})
265+
if err != nil {
266+
klog.Errorf("Failed to add pre-shutdown hook for audit-backend %s", err)
267+
}
265268
}
266269

267270
return preparedGenericAPIServer{s}

0 commit comments

Comments
 (0)