Skip to content

Commit

Permalink
fix: kill application when on 2nd termination signal provided (#5002)
Browse files Browse the repository at this point in the history
  • Loading branch information
rangoo94 authored Feb 12, 2024
1 parent 4901f3f commit 7a927b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/api-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ func main() {
case <-ctx.Done():
return nil
case sig := <-stopSignal:
go func() {
<-stopSignal
os.Exit(137)
}()
// Returning an error cancels the errgroup.
return errors.Errorf("received signal: %v", sig)
}
Expand Down
4 changes: 4 additions & 0 deletions cmd/kubectl-testkube/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ func Execute() {
case <-ctx.Done():
return nil
case sig := <-stopSignal:
go func() {
<-stopSignal
os.Exit(137)
}()
return errors.Errorf("received signal: %v", sig)
}
})
Expand Down

0 comments on commit 7a927b8

Please sign in to comment.