diff --git a/main.go b/main.go index 0449ccd119..8068f4b4fc 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,7 @@ package main import ( "context" "embed" + "os" "os/signal" "syscall" @@ -22,8 +23,22 @@ var cosignPublicKey string var zarfSchema embed.FS func main() { - ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + ctx, cancel := context.WithCancel(context.Background()) defer cancel() + signalCh := make(chan os.Signal, 1) + signal.Notify(signalCh, syscall.SIGINT, syscall.SIGTERM) + go func() { + first := true + for { + <-signalCh + if first { + first = false + cancel() + continue + } + os.Exit(1) + } + }() config.CosignPublicKey = cosignPublicKey lint.ZarfSchema = zarfSchema