controller-gen: Type aliases to array types don't work with +listType/+listMapKey markers #988
Labels
kind/bug
Categorizes issue or PR as related to a bug.
lifecycle/frozen
Indicates that an issue or PR should not be auto-closed due to staleness.
Summary
If Go type of a CRD has a field that uses
+listType
or+listMapKey
markers, but the field (struct member) is a typedef to a slice type, the field is not detected as an "array" field, and these markers cannot be applied to it.Example
Fails with error:
Details
This reproes in HEAD (as well as v0.14, v0.15).
If we do not use the declaration for the slice type (
type Conditions []Condition
) in the root object and instead use[]Conditions
as the struct member type, it works as expected.I think this is happening probably because the tool uses AST parsing, and
Conditions
struct member doesn't appear like an array in this snippet, it callsstructToSchema
instead ofarrayToSchema
./kind bug
The text was updated successfully, but these errors were encountered: