Merge pull request #107176 from Iceber/fix-request-info

if the ok returned by RequestInfoFrom is false, the requestInfo is nil
This commit is contained in:
Kubernetes Prow Robot 2022-01-06 08:58:16 -08:00 committed by GitHub
commit d754543726
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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
}