[Issue 4612][proxy] Fix proxy to forward V3 API request to functions worker cluster #6297
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #4612
Motivation
When running function workers separate from the broker, the proxy is supposed to forward function REST commands to the function worker(s), not the broker(s). This does not work since the function API is v3, but the proxy only works on v2 version of the API. This PR fixes that. It also forwards v3 sink and source command since those are served by the function worker(s) when running separately from the broker.
Modifications
Simple change to include extra V3 paths in the check for which endpoints to forward to the function worker.
Verifying this change
I have been running with this fix in multiple Pulsar setups with independent function workers for a while now. The proxy now forwards the V3 REST calls.
Does this pull request potentially affect one of the following parts:
If
yeswas chosen, please highlight the changesDocumentation