API Servers: Avoid crashing on panic (#89281)

pull/87954/head
Andres Martinez Gotor 11 months ago committed by GitHub
parent 92f10b73a8
commit 5f44c97e5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      pkg/apiserver/builder/helper.go

@ -14,6 +14,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/version"
openapinamer "k8s.io/apiserver/pkg/endpoints/openapi"
"k8s.io/apiserver/pkg/registry/generic"
@ -99,6 +100,8 @@ func SetupConfig(
handler = filters.WithAcceptHeader(handler)
handler = filters.WithPathRewriters(handler, pathRewriters)
handler = k8stracing.WithTracing(handler, serverConfig.TracerProvider, "KubernetesAPI")
// Configure filters.WithPanicRecovery to not crash on panic
utilruntime.ReallyCrash = false
return handler
}

Loading…
Cancel
Save