diff --git a/cmd/apiserver-boot/boot/util/util.go b/cmd/apiserver-boot/boot/util/util.go index 3f657d681e..0c54ca6563 100644 --- a/cmd/apiserver-boot/boot/util/util.go +++ b/cmd/apiserver-boot/boot/util/util.go @@ -28,9 +28,8 @@ import ( "strings" "text/template" - "os/signal" - "github.com/markbates/inflect" + genericapiserver "k8s.io/apiserver/pkg/server" ) var Domain string @@ -147,8 +146,7 @@ func CancelWhenSignaled(parent context.Context) context.Context { ctx, cancel := context.WithCancel(parent) go func() { - signalChannel := make(chan os.Signal) - signal.Notify(signalChannel, os.Interrupt, os.Kill) + signalChannel := genericapiserver.SetupSignalHandler() <-signalChannel cancel() }()