implement helper angryjet functions#86
Conversation
ac58d4d to
e70fbb0
Compare
e70fbb0 to
1546903
Compare
|
Thanks @ldalorion! I know in a lot of places we've started using https://pkg.go.dev/k8s.io/utils/ptr instead of the pointer utils that used to be in crossplane-runtime. Do you think we could use that library here in crossplane-tools? |
|
Yes! Started to make changes using that utility but replacing the functions that looped through each pointer and floating numbers was not as straightforward. So I just did a straight copypasta from crossplane-runtime first. I wanted to make sure that I was on the right path before investing anymore time and effort. |
740ebfe to
cac74f8
Compare
|
@negz Soooo i tried to use them as much as possible but since we're converting strings to numbers (floats/ints) and back there's not much that the utility can replace. 😬 |
| return strconv.FormatInt(*v, 10) | ||
| } | ||
|
|
||
| // ToPtrValue adapts a ResolvedValue for use as a string pointer field. |
There was a problem hiding this comment.
| // ToPtrValue adapts a ResolvedValue for use as a string pointer field. | |
| // ToPtrValue adapts a ResolvedValue for use as a string pointer field. | |
| // | |
| // Deprecated: Use ptr.To from k8s.io/utils/ptr. |
| // throughout the Crossplane codebase. We duplicate them here to reduce the | ||
| // number of packages our API types have to import to support references. | ||
|
|
||
| // FromPtrValue adapts a string pointer field for use as a CurrentValue. |
There was a problem hiding this comment.
//
// Deprecated: Use ptr.Deref from k8s.io/utils/ptr.Not sure what happened here - this was supposed to be a suggestion to expand the comment.
…ions Signed-off-by: L. Dalorion Johnson <ldalorion@users.noreply.github.com>
cac74f8 to
6507791
Compare
|
@negz Added an additional change to update the generated code to not use the now deprecated helper functions |
negz
left a comment
There was a problem hiding this comment.
Thanks for updating the generated code!
|
Is there anything blocking this? |
Description of your changes
The removal of the pointer helper methods in crossplane-runtime v1.19.0 will now make angryjet generate invalid code.
https://github.com/crossplane/crossplane-runtime/pull/780/files
Fixes # crossplane/crossplane-runtime#762
I have:
make reviewable testto ensure this PR is ready for review.How has this code been tested
Updated go.mod file of provider-upbound to point to my changes locally
ran the go commands to pull the changes into the environment
deployed the changes to my local kind cluster
applied resources to the cluster and verified that they eventually were synced and ready.
TODO: apply changes to local provider-upjet-gcp and run uptest locallyRan uptest against provider-upjet-gcp with it pointing to my changes. Did the same setup for provider-upbound but ran
make uptestagainst the storage bucket example.test passed