if the ok returned by RequestInfoFrom is false, the requestInfo is nil

This commit is contained in:
Iceber Gu 2021-12-22 11:25:53 +08:00
parent ba8410ea5f
commit e2bf6ca204

View File

@ -235,7 +235,7 @@ func (r *crdHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
if !ok {
responsewriters.ErrorNegotiated(
apierrors.NewInternalError(fmt.Errorf("no RequestInfo found in the context")),
Codecs, schema.GroupVersion{Group: requestInfo.APIGroup, Version: requestInfo.APIVersion}, w, req,
Codecs, schema.GroupVersion{}, w, req,
)
return
}