Skip to content

Commit

Permalink
Merge branch 'main' into fix/packager-context
Browse files Browse the repository at this point in the history
  • Loading branch information
AustinAbro321 committed Jun 7, 2024
2 parents 1e51325 + 7ad3e53 commit d04fa1b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package main
import (
"context"
"embed"
"os"
"os/signal"
"syscall"

Expand All @@ -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
Expand Down

0 comments on commit d04fa1b

Please sign in to comment.