Skip to content

Conversation

negz
Copy link
Member

@negz negz commented Aug 16, 2024

Description of your changes

This PR compliments crossplane/crossplane#5885, which promotes functions to v1 in Crossplane.

Crossplane v1.17 and above will send requests to apiextensions.fn.proto.v1.FunctionRunnerService. It'll fall back to apiextensions.fn.proto.v1beta1.FunctionRunnerService if v1 isn't available. Crossplane v1.16 and earlier will only send requests to apiextensions.fn.proto.v1beta1.FunctionRunnerService.

Going forward we want functions to serve apiextensions.fn.proto.v1.FunctionRunnerService. However, to avoid breaking compatibility with Crossplane v1.16 and earlier they'll also need to serve apiextensions.fn.proto.v1beta1.FunctionRunnerService.

This PR:

  • Updates the SDK to use v1 types.
  • Adds a BetaFunctionRunner middleware that serves v1beta1 requests by wrapping a v1 server.

This wrapping approach only works because we intend v1 to be identical to v1beta1. That is, we promoted v1beta1 to v1 without making any breaking changes. In upstream Crossplane the v1beta1 proto is now automatically replicated from the v1 proto to ensure they remain identical.

I have:

@negz negz force-pushed the its-happening-dot-gif branch from 459057b to 1324ac8 Compare August 16, 2024 21:47
@negz negz force-pushed the its-happening-dot-gif branch from 1324ac8 to 0f7d85f Compare August 16, 2024 22:05
@negz
Copy link
Member Author

negz commented Aug 16, 2024

I tested this by:

The function successfully served both (after fixing a bug or two), so I think this is good to go.

@negz negz marked this pull request as ready for review August 16, 2024 22:06
@negz negz merged commit f8f842d into crossplane:main Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants