Merge pull request #828 from enj/enj/i/supervisor_graceful_exit

supervisor: ensure graceful exit
This commit is contained in:
Mo Khan 2021-08-28 13:40:13 -04:00 committed by GitHub
commit d2dfe3634a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -14,6 +14,7 @@ import (
"os"
"os/signal"
"strings"
"syscall"
"time"
appsv1 "k8s.io/api/apps/v1"
@ -78,7 +79,7 @@ func start(ctx context.Context, l net.Listener, handler http.Handler) {
func waitForSignal() os.Signal {
signalCh := make(chan os.Signal, 1)
signal.Notify(signalCh, os.Interrupt)
signal.Notify(signalCh, os.Interrupt, syscall.SIGTERM)
return <-signalCh
}