Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle maps to structs in schema #37

Merged
merged 7 commits into from
Mar 2, 2022
Merged

Handle maps to structs in schema #37

merged 7 commits into from
Mar 2, 2022

Conversation

clux
Copy link
Member

@clux clux commented Mar 1, 2022

Fixes #21 once it is done. Missing the recursion piece. We are generating the struct now.

clux added 6 commits March 1, 2022 06:32
Signed-off-by: clux <sszynrae@gmail.com>
Signed-off-by: clux <sszynrae@gmail.com>
Signed-off-by: clux <sszynrae@gmail.com>
Signed-off-by: clux <sszynrae@gmail.com>
Signed-off-by: clux <sszynrae@gmail.com>
Signed-off-by: clux <sszynrae@gmail.com>
@clux
Copy link
Member Author

clux commented Mar 1, 2022

I think this is actually handling the case BTreeMap<String, SomeStruct> which i guess we hadn't seen before, and the additional props inlines the struct in the usual btreemap case. Have filled in as much as I have test data for.

@imp are you able to verify this against any instances of clusters.cluster.x-k8s.io you might have? (and if possible do you have a secret-sanitized instance we can use for a test case?) I think we are fixing the issue here now (in combination with the earlier fixes), but would be good to know before releasing since the test case here only covers generation not serialization.

@clux clux marked this pull request as ready for review March 1, 2022 08:27
@clux
Copy link
Member Author

clux commented Mar 1, 2022

The big unknowns to me are if this really is a BTreeMap case (most documentation i find on the crd are unclear on this - they just say object) and if so, do we need to recurse further down into it.

found a better source

Signed-off-by: clux <sszynrae@gmail.com>
@clux
Copy link
Member Author

clux commented Mar 2, 2022

Going to merge this for now. It is definitely better with this in that not. I don't think the BTreeMap<String, SomeStruct> case works without it.

@clux clux changed the title Handle excessively nested object properties Handle maps to structs in schema Mar 2, 2022
@clux clux merged commit 3709ca1 into main Mar 2, 2022
@clux clux deleted the clusterobj branch March 2, 2022 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type name generation for complex spec is broken
1 participant