Merge pull request #110212 from aojea/fix_agnhost_sigterm

agnhost: fix sigterm shutdown
This commit is contained in:
Kubernetes Prow Robot
2022-05-25 06:38:44 -07:00
committed by GitHub
2 changed files with 7 additions and 7 deletions

View File

@@ -1 +1 @@
2.38
2.39

View File

@@ -175,14 +175,14 @@ func main(cmd *cobra.Command, args []string) {
close(sigTermReceived)
}()
if delayShutdown > 0 {
go func() {
<-sigTermReceived
go func() {
<-sigTermReceived
if delayShutdown > 0 {
log.Printf("Sleeping %d seconds before terminating...", delayShutdown)
time.Sleep(time.Duration(delayShutdown) * time.Second)
os.Exit(0)
}()
}
}
os.Exit(0)
}()
if httpOverride != "" {
mux := http.NewServeMux()