mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
update StatusDetails to handle Groups
This commit is contained in:
@@ -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