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 <[email protected]>
  • Loading branch information
wallrj committed Aug 30, 2019
1 parent 22b0482 commit 0848b1d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 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,9 @@ import (
"strings"
"text/template"

"os/signal"

"github.com/markbates/inflect"

"sigs.k8s.io/apiserver-builder-alpha/cmd/apiserver-boot/boot/util/signal"
)

var Domain string
Expand Down Expand Up @@ -147,8 +147,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 := signal.SetupSignalHandler()
<-signalChannel
cancel()
}()
Expand Down

0 comments on commit 0848b1d

Please sign in to comment.