Change:
Remove panic in , please return error instead following .
/sig api-machinery /good-first-issue
This request has been marked as suitable for new contributors. Please ensure the request meets the requirements listed . If this request no longer meets these requirements, the label can be removed by commenting with the command. <detailsIn response to : /sig api-machinery /good-first-issue Instructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
/assign
Please also add some log if returns error
/remove-kind bug /kind cleanup

Discussion:
func (s *store) Delete(ctx context.Context, key string, out runtime.Object, preconditions *storage.Preconditions, validateDeletion storage.ValidateObjectFunc) error { v, err := conversion.EnforcePtr(out) if err != nil { <del> panic("unable to convert output object to pointer") </del> <ins> return fmt.Errorf("unable to convert output object to pointer: %v", err) </ins> } key = path.Join(s.pathPrefix, key) return s.conditionalDelete(ctx, key, out, v, preconditions, validateDeletion)

v, err := conversion.EnforcePtr(out) if err != nil { <del> panic("unable to convert output object to pointer") </del> <ins> return fmt.Errorf("unable to convert output object to pointer: %v", err) </ins> } key = path.Join(s.pathPrefix, key)

} v, err := conversion.EnforcePtr(listPtr) if err != nil || v.Kind() != reflect.Slice { <del> panic("need ptr to slice") </del> <ins> return fmt.Errorf("need ptr to slice: %v", err) </ins> } key = path.Join(s.pathPrefix, key)

} v, err := conversion.EnforcePtr(listPtr) if err != nil || v.Kind() != reflect.Slice { <del> panic("need ptr to slice") </del> <ins> return fmt.Errorf("need ptr to slice: %v", err) </ins> } if s.pathPrefix != "" {

if err != nil { return nil, err } <del> s.versioner.UpdateObject(state.obj, uint64(rv)) </del> <ins> if err := s.versioner.UpdateObject(state.obj, uint64(rv)); err != nil { klog.Errorf("failed to update object version: %v", err) } </ins> return state, nil }

// On success, objPtr would be set to the object. func decode(codec runtime.Codec, versioner storage.Versioner, value []byte, objPtr runtime.Object, rev int64) error { if _, err := conversion.EnforcePtr(objPtr); err != nil { <del> panic("unable to convert output object to pointer") </del> <ins> return fmt.Errorf("unable to convert output object to pointer: %v", err) </ins> } _, _, err := codec.Decode(value, nil, objPtr) if err != nil { return err } // being unable to set the version does not prevent the object from being extracted <del> versioner.UpdateObject(objPtr, uint64(rev)) </del> <ins> if err := versioner.UpdateObject(objPtr, uint64(rev)); err != nil { klog.Errorf("failed to update object version: %v", err) } </ins> return nil }

return err } // being unable to set the version does not prevent the object from being extracted <del> versioner.UpdateObject(obj, rev) </del> <ins> if err := versioner.UpdateObject(obj, rev); err != nil { klog.Errorf("failed to update object version: %v", err) } </ins> if matched, err := pred.Matches(obj); err == nil && matched { v.Set(reflect.Append(v, reflect.ValueOf(obj).Elem())) }