mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Add crash handler bypass for testing.
This commit is contained in:
parent
0760e9bc2c
commit
011ce9d871
@ -38,6 +38,7 @@ import (
|
||||
|
||||
func main() {
|
||||
runtime.GOMAXPROCS(4)
|
||||
util.ReallyCrash = true
|
||||
util.InitLogs()
|
||||
defer util.FlushLogs()
|
||||
|
||||
|
@ -25,8 +25,15 @@ import (
|
||||
"github.com/golang/glog"
|
||||
)
|
||||
|
||||
// For testing, bypass HandleCrash.
|
||||
var ReallyCrash bool
|
||||
|
||||
// Simply catches a crash and logs an error. Meant to be called via defer.
|
||||
func HandleCrash() {
|
||||
if ReallyCrash {
|
||||
return
|
||||
}
|
||||
|
||||
r := recover()
|
||||
if r != nil {
|
||||
callers := ""
|
||||
|
Loading…
Reference in New Issue
Block a user