mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-05 11:12:03 +00:00
Merge pull request #110212 from aojea/fix_agnhost_sigterm
agnhost: fix sigterm shutdown
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user