mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +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)
|
close(sigTermReceived)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if delayShutdown > 0 {
|
go func() {
|
||||||
go func() {
|
<-sigTermReceived
|
||||||
<-sigTermReceived
|
if delayShutdown > 0 {
|
||||||
log.Printf("Sleeping %d seconds before terminating...", delayShutdown)
|
log.Printf("Sleeping %d seconds before terminating...", delayShutdown)
|
||||||
time.Sleep(time.Duration(delayShutdown) * time.Second)
|
time.Sleep(time.Duration(delayShutdown) * time.Second)
|
||||||
os.Exit(0)
|
}
|
||||||
}()
|
os.Exit(0)
|
||||||
}
|
}()
|
||||||
|
|
||||||
if httpOverride != "" {
|
if httpOverride != "" {
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
|
Loading…
Reference in New Issue
Block a user