// extractFromTypeMeta extracts pointers to version and kind fields from an object func extractFromTypeMeta(v reflect.Value, a *genericAccessor) error { if err := runtime.FieldPtr(v, "APIVersion", &a.apiVersion); err != nil { return err } if err := runtime.FieldPtr(v, "Kind", &a.kind); err != nil { return err } return nil }
// ListMetaFor returns a pointer to a provided object's ListMeta, // or an error if the object does not have that pointer. // TODO: allow runtime.Unknown to extract this object // TODO: Remove this function and use meta.ObjectMetaAccessor() instead. func ListMetaFor(obj runtime.Object) (*ListMeta, error) { v, err := conversion.EnforcePtr(obj) if err != nil { return nil, err } var meta *ListMeta err = runtime.FieldPtr(v, "ListMeta", &meta) return meta, err }