Update guide on how to write a composition function in Go after v2 updates#1045
Conversation
✅ Deploy Preview for crossplane ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Signed-off-by: Jonasz Łasut-Balcerzak <jonasz.lasut@gmail.com>
c956fdf to
51b9796
Compare
jbw976
left a comment
There was a problem hiding this comment.
Thanks for tackling this @jonasz-lasut!! it will be great to have this guide working again since moving to v2 😇
| "k8s.io/utils/ptr" | ||
|
|
||
| "github.com/crossplane-contrib/provider-upjet-aws/apis/s3/v1beta1" | ||
| "github.com/upbound/provider-aws/v2/apis/namespaced/s3/v1beta1" |
There was a problem hiding this comment.
ah interesting, i was hoping that we'd still be able to use the github repo path (github.com/crossplane-contrib/provider-upjet-aws, not the module path (github.com/upbound/provider-aws), but that doesn't appear to be possible:
❯ go get github.com/crossplane-contrib/provider-upjet-aws/v2@v2.3.0
go: downloading github.com/crossplane-contrib/provider-upjet-aws/v2 v2.3.0
go: github.com/crossplane-contrib/provider-upjet-aws/v2@v2.3.0 requires go >= 1.24.10; switching to go1.24.12
go: github.com/crossplane-contrib/provider-upjet-aws/v2@v2.3.0 requires github.com/crossplane-contrib/provider-upjet-aws/v2@v2.3.0: parsing go.mod:
module declares its path as: github.com/upbound/provider-aws/v2
but was required as: github.com/crossplane-contrib/provider-upjet-aws/v2
probably the same error you hit 😂
OK if we need to use the go module path, then that is reasonable!
There was a problem hiding this comment.
Exactly the same error 😅 We could handle that with go mod -replace ... but I didn't think it's worth to introduce that as it makes the guide less clear only for sake of keeping the crossplane-contrib in the module name
There was a problem hiding this comment.
yep agreed! and API groups / module names are permitted to stay as their original source before donation to crossplane-contrib as per governance, so all good!
https://github.com/crossplane/crossplane/blob/main/GOVERNANCE.md#policies-for-community-extension-projects

Fixes #1003
Updated go get instruction for AWS Provider Go module and fixed import paths that were leading to function not compiling and not passing tests.
github.com/upbound/provider-aws/v2 import has to use at least version
v2.3.0as it's the first version with the correct module path