Browse Source

Merge pull request #1599 from gravitl/bugfix_v0.16.1_netmaker_shutdown

shutdown netmaker on receipt of sigterm
Alex Feiszli 2 years ago
parent
commit
826017dc0d
1 changed files with 2 additions and 1 deletions
  1. 2 1
      controllers/controller.go

+ 2 - 1
controllers/controller.go

@@ -7,6 +7,7 @@ import (
 	"os"
 	"os/signal"
 	"sync"
+	"syscall"
 	"time"
 
 	"github.com/gorilla/handlers"
@@ -59,7 +60,7 @@ func HandleRESTRequests(wg *sync.WaitGroup) {
 
 	// Relay os.Interrupt to our channel (os.Interrupt = CTRL+C)
 	// Ignore other incoming signals
-	ctx, stop := signal.NotifyContext(context.TODO(), os.Interrupt)
+	ctx, stop := signal.NotifyContext(context.TODO(), syscall.SIGTERM, os.Interrupt)
 	defer stop()
 
 	// Block main routine until a signal is received