Skip to content

Commit

Permalink
Reuse SetupSignalHandler from k8s.io/apiserver
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
  • Loading branch information
wallrj committed Aug 30, 2019
1 parent f73bfd8 commit 2b47bb9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cmd/apiserver-boot/boot/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ import (
"strings"
"text/template"

"os/signal"

"github.com/markbates/inflect"
genericapiserver "k8s.io/apiserver/pkg/server"
)

var Domain string
Expand Down Expand Up @@ -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()
}()
Expand Down

0 comments on commit 2b47bb9

Please sign in to comment.