1
0
mirror of https://github.com/rancher/types.git synced 2025-09-24 19:39:13 +00:00

Update vendor

This commit is contained in:
Darren Shepherd
2017-11-28 17:36:07 -07:00
parent 1910c3f82e
commit 4b4de1dd9d
2 changed files with 29 additions and 1 deletions

View File

@@ -3,5 +3,5 @@ github.com/rancher/types
k8s.io/kubernetes v1.8.3 transitive=true,staging=true
bitbucket.org/ww/goautoneg a547fc61f48d567d5b4ec6f8aee5573d8efce11d https://github.com/rancher/goautoneg.git
github.com/rancher/norman 9be32ca0a540082e23a24a2b46127b5c205db262
github.com/rancher/norman 391a96f33dd0b1f893f8b194e2d7cad3e26d1351
golang.org/x/sync fd80eb99c8f653c847d294a001bdf2a3a6f768f5

28
vendor/github.com/rancher/norman/signal/sigterm.go generated vendored Normal file
View File

@@ -0,0 +1,28 @@
package signal
import (
"context"
"os"
"os/signal"
"syscall"
"github.com/sirupsen/logrus"
)
func SigTermCancelContext(ctx context.Context) context.Context {
term := make(chan os.Signal)
signal.Notify(term, os.Interrupt, syscall.SIGTERM)
ctx, cancel := context.WithCancel(ctx)
go func() {
select {
case <-term:
logrus.Infof("Received SIGTERM, cancelling")
cancel()
case <-ctx.Done():
}
}()
return ctx
}