Update to function-sdk-go 0.5.0#498
Conversation
8c2e1a4 to
89d5e73
Compare
fn.go
Outdated
|
|
||
| // Initialize the requirements. | ||
| requirements := &fnv1.Requirements{ExtraResources: make(map[string]*fnv1.ResourceSelector)} | ||
| requirements := &fnv1.Requirements{Resources: make(map[string]*fnv1.ResourceSelector)} |
There was a problem hiding this comment.
Switching from ExtraResources to Resources will break things
See crossplane/function-sdk-go#219
There was a problem hiding this comment.
Yep, that's why I put it back in Draft. We need to maintain the existing API to the user, which means adding the "extraResources" key into the template context with the same content as "requiredResources". Not ideal, but here we are.
There was a problem hiding this comment.
Good catch @tenitski, thanks for the reminder here! 😥
There was a problem hiding this comment.
@negz - how does this work with a version of Crossplane that is still using the v1 version of the protobuf? Are we going to break ExtraResources functionality for older releases of Crossplane by changing this?
I'm concerned that this change may mean that the function now only works with v2 core Crossplane. Maybe we need to handle both message attributes for some interval until v1 Crossplane is completely unsupported.
There was a problem hiding this comment.
I'm leaning towards a solution where namespaced extra resources use the new "resources" field and non-namespaced extra resources use the deprecated "extra_resources" field. That allows existing v1 core Crossplane deployments to continue working and v2 deployments can use the namespaced extra resources. Then if/when v1 Crossplane is declared dead we can update the function to use "resources" for all cases.
The existing "ExtraResources" API in the template will remain as it is not worth breaking backwards compatibility.
Thoughts/concerns?
There was a problem hiding this comment.
I'm over-thinking this - we can continue to use rsp.requirements["extra_resources"] since it is supported in both v1 and v2 of Crossplane core, and we can accept both req.extra_resources and req.required_resources. I'll push an updated patchset.
Signed-off-by: Bob Haddleton <bob.haddleton@nokia.com>
Signed-off-by: Bob Haddleton <bob.haddleton@nokia.com>
Signed-off-by: Bob Haddleton <bob.haddleton@nokia.com>
Signed-off-by: Bob Haddleton <bob.haddleton@nokia.com>
Signed-off-by: Bob Haddleton <bob.haddleton@nokia.com>
…to-ready docker tag to v0.6.0
…ovate/examples chore(deps): update xpkg.crossplane.io/crossplane-contrib/function-auto-ready docker tag to v0.6.0
…ovate/google.golang.org-protobuf-1.x fix(deps): update module google.golang.org/protobuf to v1.36.11
Signed-off-by: Bob Haddleton <bob.haddleton@nokia.com>
Signed-off-by: Bob Haddleton <bob.haddleton@nokia.com>
Signed-off-by: Bob Haddleton <bob.haddleton@nokia.com>
Signed-off-by: Bob Haddleton <bob.haddleton@nokia.com>
Signed-off-by: Bob Haddleton <bob.haddleton@nokia.com>
Description of your changes
Update to function-sdk-go 0.5.0 which includes crossplane-runtime v2
I have: