mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 02:41:25 +00:00
Merge pull request #110212 from aojea/fix_agnhost_sigterm
agnhost: fix sigterm shutdown
This commit is contained in:
commit
1290d6a4c0
@ -1 +1 @@
|
||||
2.38
|
||||
2.39
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user