Details
Description
We should have the ability to unmarshal types and use annotations to set values.
Requirements:
1) A tag may optionally be placed on any field of any crd Type called "annotation_url" that will specify which annotation can set that field's value.
2) A custom unmarshal method will be created that can recursively check all fields for matching annotation_url tags to map.
See https://replit.com/@JustinAshworth2/SuperbImmaculateDigits#main.go for an example.
3) The unmarshal method needs to set fields for primatives only (bool, string, int, duration). It should only recurse on structs
4) There needs to be unit tests for the following:
a. Bool, int, string, duration fields on the root of the object that has annotations
b. Bool, int, string, duration inside the spec of the root object
c. Bool, int, string, duration nested inside a struct within the spec of the root object
d. Bool, int, string, duration nested inside a struct, within a struct, within the spec of the root object
e. Unit tests where the passed fields are not pointers (This should error, as you cannot use reflection to set non-pointer types)
Attachments
Issue Links
- blocks
-
K8S-2951 Add support for new API changes in Couchbase Server 7.2
- Closed