From b527e612751f001dc7cea486fcfb7898f1854601 Mon Sep 17 00:00:00 2001 From: Michael Borst Date: Mon, 2 May 2022 14:43:07 +0200 Subject: [PATCH] [registry] Handle SIGTERM gracefully This allows handling default k8s behavior [1]. [1] https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination --- cmd/registry/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/registry/main.go b/cmd/registry/main.go index 43e477c..88c914b 100644 --- a/cmd/registry/main.go +++ b/cmd/registry/main.go @@ -9,6 +9,7 @@ import ( "os/signal" "strings" "sync" + "syscall" "time" "github.com/DataDog/kafka-kit/v3/kafkaadmin" @@ -166,7 +167,7 @@ func main() { // Graceful shutdown on SIGINT. c := make(chan os.Signal, 1) - signal.Notify(c, os.Interrupt) + signal.Notify(c, os.Interrupt, syscall.SIGTERM) go func() { <-c cancel()