Skip to content

Commit

Permalink
Wait for shutdown signal
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew DeVenny <[email protected]>
  • Loading branch information
matthewdevenny committed Jun 29, 2023
1 parent 687c5de commit 1983a79
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
package cmd

import (
"os"
"os/signal"
"syscall"

"github.com/boxboat/k8s-tpm-device/pkg/common"
"github.com/boxboat/k8s-tpm-device/pkg/plugin"
"github.com/intel/intel-device-plugins-for-kubernetes/pkg/deviceplugin"
Expand All @@ -37,6 +41,11 @@ func runPlugin() {
go func() {
manager.Run()
}()

// listen for shutdown signal
signalChan := make(chan os.Signal, 1)
signal.Notify(signalChan, syscall.SIGINT, syscall.SIGTERM)
<-signalChan
}

var runCmd = &cobra.Command{
Expand Down

0 comments on commit 1983a79

Please sign in to comment.