Commit c6206c19 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #42277 from liggitt/group-resource-error

Automatic merge from submit-queue Only set a groupresource on errors if a resource was specified @deads2k this gets rid of the weird .meta.k8s.io error on unauthorized errors
parents f12db38d 69510237
...@@ -1035,13 +1035,15 @@ func (r *Request) newUnstructuredResponseError(body []byte, isTextResponse bool, ...@@ -1035,13 +1035,15 @@ func (r *Request) newUnstructuredResponseError(body []byte, isTextResponse bool,
if isTextResponse { if isTextResponse {
message = strings.TrimSpace(string(body)) message = strings.TrimSpace(string(body))
} }
var groupResource schema.GroupResource
if len(r.resource) > 0 {
groupResource.Group = r.content.GroupVersion.Group
groupResource.Resource = r.resource
}
return errors.NewGenericServerResponse( return errors.NewGenericServerResponse(
statusCode, statusCode,
method, method,
schema.GroupResource{ groupResource,
Group: r.content.GroupVersion.Group,
Resource: r.resource,
},
r.resourceName, r.resourceName,
message, message,
retryAfter, retryAfter,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment