Skip to content

Commit

Permalink
Merge pull request #152 from Mixaster995/main
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-tingaikin authored Apr 22, 2021
2 parents c6b383b + f688d73 commit a39c18a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.15-buster as go
FROM golang:1.16-buster as go
ENV GO111MODULE=on
ENV CGO_ENABLED=0
ENV GOBIN=/bin
Expand Down
3 changes: 2 additions & 1 deletion internal/pkg/imports/imports_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
_ "github.com/networkservicemesh/sdk/pkg/tools/log"
_ "github.com/networkservicemesh/sdk/pkg/tools/log/logruslogger"
_ "github.com/networkservicemesh/sdk/pkg/tools/opentracing"
_ "github.com/networkservicemesh/sdk/pkg/tools/signalctx"
_ "github.com/networkservicemesh/sdk/pkg/tools/spiffejwt"
_ "github.com/networkservicemesh/sdk/pkg/tools/spire"
_ "github.com/pkg/errors"
Expand All @@ -49,7 +48,9 @@ import (
_ "net"
_ "net/url"
_ "os"
_ "os/signal"
_ "path/filepath"
_ "syscall"
_ "testing"
_ "time"
)
14 changes: 11 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ import (
"net"
"net/url"
"os"
"os/signal"
"path/filepath"
"syscall"
"time"

nested "github.com/antonfisher/nested-logrus-formatter"
Expand Down Expand Up @@ -56,7 +58,6 @@ import (
"github.com/networkservicemesh/sdk/pkg/tools/log"
"github.com/networkservicemesh/sdk/pkg/tools/log/logruslogger"
"github.com/networkservicemesh/sdk/pkg/tools/opentracing"
"github.com/networkservicemesh/sdk/pkg/tools/signalctx"
"github.com/networkservicemesh/sdk/pkg/tools/spiffejwt"
)

Expand Down Expand Up @@ -87,8 +88,15 @@ func main() {
// ********************************************************************************
// setup context to catch signals
// ********************************************************************************
ctx := signalctx.WithSignals(context.Background())
ctx, cancel := context.WithCancel(ctx)
ctx, cancel := signal.NotifyContext(
context.Background(),
os.Interrupt,
// More Linux signals here
syscall.SIGHUP,
syscall.SIGTERM,
syscall.SIGQUIT,
)
defer cancel()

// ********************************************************************************
// setup logging
Expand Down

0 comments on commit a39c18a

Please sign in to comment.