-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
test(crd-generator): approval tests for crd-generator-api-v2 #5991
Conversation
Hi @shawkins, Maybe you can help out here. This PR adds the tests to ensure feature parity for both versions of the crd-generator. However, there's a misbehavior, but I'm unsure if this is because something is missing in the new implementation or there's a bug in the old one. The approval file Lines 22 to 30 in e3f2ae9
which are not generated with the new implementation. This fragment looks instead like: foo:
type: "object" |
@manusa the new one is correct with the default settings. We now have a CRDGenerator property to control whether x-kubernetes-preserve-unknown-fields is implicitly inferred from anyGetter/Setter - it defaults to false. It would need to use the crd annotation for preserve unknown or turn on the implicit setting for this to be seen as x-kubernetes-preserve-unknown-fields. At the very least, the old one should not have been adding both a configAsMap property and setting x-kubernetes-preserve-unknown-fields - because that was derived from configAsMap. |
Signed-off-by: Marc Nuri <[email protected]>
03da73d
to
a04ca3d
Compare
IMHO fixing the test for now is better here than changing something in v1 or v2. Maybe we can add some test cases later to show the differences or a Wiki page to document such things. |
…getter/setter) Signed-off-by: Marc Nuri <[email protected]>
👍 I removed the conflicting field + class. |
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Part of #5951 / #5948
Supersedes closes #5978
test(crd-generator): approval tests for crd-generator-api-v2
Relates to:
Type of change
test, version modification, documentation, etc.)
Checklist