-
Notifications
You must be signed in to change notification settings - Fork 206
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
Use real API Version enums #2285
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2285 +/- ##
==========================================
+ Coverage 53.12% 53.25% +0.12%
==========================================
Files 807 808 +1
Lines 238594 245438 +6844
==========================================
+ Hits 126757 130699 +3942
- Misses 93968 96242 +2274
- Partials 17869 18497 +628
Continue to review full report at Codecov.
|
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.
A couple of minor suggestions, but otherwise looks good.
// HACK: include the APIVersion in the storage types package. | ||
// really we don't want storage types to have API Version at all, | ||
// but it's difficult to remove the GetApiVersion() Function at the moment | ||
storageAPIVersions := make(astmodel.TypeNameSet) | ||
for _, tdef := range typesToConvert { | ||
if rt, ok := astmodel.AsResourceType(tdef.Type()); ok && rt.HasAPIVersion() { | ||
storageAPIVersions.Add(rt.APIVersionTypeName()) | ||
} | ||
} | ||
|
||
for name := range storageAPIVersions { | ||
typesToConvert.Add(state.Definitions()[name]) | ||
} | ||
|
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.
Could this be done by modifying (and renaming) the predicate isResourceOrObject
instead?
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.
Not very easily, it would require another pass. I think it's good to call this out as the HACK that it is 😁
Ideally we wouldn't have these at all in the storage types, so this is a reminder that we would like to remove them in future.
...nal/codegen/testdata/ArmResource/Arm_test_dependent_resource_and_ownership_crossplane.golden
Show resolved
Hide resolved
Co-authored-by: Matthew Christopher <[email protected]>
This fixes #1554