mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-26 19:35:10 +00:00
update StatusDetails to handle Groups
This commit is contained in:
@@ -58,7 +58,7 @@ func TestTryAcquireOrRenew(t *testing.T) {
|
||||
{
|
||||
verb: "get",
|
||||
reaction: func(action testclient.Action) (handled bool, ret runtime.Object, err error) {
|
||||
return true, nil, errors.NewNotFound(action.GetVerb(), action.(testclient.GetAction).GetName())
|
||||
return true, nil, errors.NewNotFound(api.Resource(action.(testclient.GetAction).GetResource()), action.(testclient.GetAction).GetName())
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -896,7 +896,7 @@ func (r *Request) transformUnstructuredResponseError(resp *http.Response, req *h
|
||||
message = strings.TrimSpace(string(body))
|
||||
}
|
||||
retryAfter, _ := retryAfterSeconds(resp)
|
||||
return errors.NewGenericServerResponse(resp.StatusCode, req.Method, r.resource, r.resourceName, message, retryAfter, true)
|
||||
return errors.NewGenericServerResponse(resp.StatusCode, req.Method, unversioned.GroupResource{Group: r.groupVersion.Group, Resource: r.resource}, r.resourceName, message, retryAfter, true)
|
||||
}
|
||||
|
||||
// isTextResponse returns true if the response appears to be a textual media type.
|
||||
|
||||
@@ -181,7 +181,7 @@ func (o objects) Kind(kind unversioned.GroupVersionKind, name string) (runtime.O
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
return nilValue, errors.NewNotFound(kind.Kind, name)
|
||||
return nilValue, errors.NewNotFound(unversioned.GroupResource{Group: kind.Group, Resource: kind.Kind}, name)
|
||||
}
|
||||
|
||||
index := o.last[kind.Kind]
|
||||
@@ -189,7 +189,7 @@ func (o objects) Kind(kind unversioned.GroupVersionKind, name string) (runtime.O
|
||||
index = len(arr) - 1
|
||||
}
|
||||
if index < 0 {
|
||||
return nilValue, errors.NewNotFound(kind.Kind, name)
|
||||
return nilValue, errors.NewNotFound(unversioned.GroupResource{Group: kind.Group, Resource: kind.Kind}, name)
|
||||
}
|
||||
out, err := o.scheme.Copy(arr[index])
|
||||
if err != nil {
|
||||
|
||||
@@ -56,9 +56,9 @@ func TestErrors(t *testing.T) {
|
||||
o.Add(&api.List{
|
||||
Items: []runtime.Object{
|
||||
// This first call to List will return this error
|
||||
&(errors.NewNotFound("ServiceList", "").(*errors.StatusError).ErrStatus),
|
||||
&(errors.NewNotFound(api.Resource("ServiceList"), "").(*errors.StatusError).ErrStatus),
|
||||
// The second call to List will return this error
|
||||
&(errors.NewForbidden("ServiceList", "", nil).(*errors.StatusError).ErrStatus),
|
||||
&(errors.NewForbidden(api.Resource("ServiceList"), "", nil).(*errors.StatusError).ErrStatus),
|
||||
},
|
||||
})
|
||||
client := &Fake{}
|
||||
|
||||
Reference in New Issue
Block a user