-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code review PR of #789 - HTTP paths for functions #832
Conversation
…atchdog. Previously, only the query string of the URL was passed through the Gateway. With this change, the entire path requested by the client is passed through as well as the query string. While fwatchdog already supported passing the path through, in practice this would not happen since the Gateway would have swallowed it before forwarding the request to the watchdog. With this change, the path portion after the function name is added to the Http_Path environment variable, provided that cgiHeaders are enabled. This is similar to the of-watchdog equivalent. Signed-off-by: Thomas E Lackey <[email protected]>
…tion prefix trimming instead of baking it in. Also add a configuration option, 'pass_url_path_to_functions' to control whether the full path is passed to the functions or not. Signed-off-by: Thomas E Lackey <[email protected]>
Signed-off-by: Thomas E Lackey <[email protected]>
…ync functions as well. Signed-off-by: Thomas E Lackey <[email protected]>
This reviews the code and fixes up suggestions made by team for the HTTP paths PR #789. - Removed feature-flag (this is backwards-compatible, so I see no value in adding the flag) - There was a URL transform happening for calls proxied to the back end, I changed this for the nil-transform - i.e. it does not change anything in the URL - Introduced variables to describe the regex indicies used in the URL trimming. Tested with Docker Swarm with a ruby-microservice, with system calls and with function calls using the UI. Signed-off-by: Alex Ellis (VMware) <[email protected]>
Async Path passing is now tested:
Also tested with Path is empty when nothing is passed after I tested the path work via Ivana's Ruby guestbook including GET/POST endpoints at different paths.
|
Signed-off-by: Alex Ellis (VMware) <[email protected]>
@telackey please confirm that the original intent is still matched in this follow-up PR.
|
Signed-off-by: Alex Ellis (VMware) <[email protected]>
This was altered to "alexellis" for building a testing image, but shouldn't have been pushed. Reverting. Signed-off-by: Alex Ellis (VMware) <[email protected]>
I tested with http://127.0.0.1:8080/function/guestbook/signatures?guest=test%20bar&firstname=test&lastname=bar Also tested async functions with path parameters. |
Using this gateway, function invocation count does not increase. Tested both in the UI and Prometheus by After reverting to |
Can you find out why? |
@alexellis I'm looking into it |
gateway/handlers/forwarding_proxy.go
Outdated
return func(w http.ResponseWriter, r *http.Request) { | ||
baseURL := baseURLResolver.Resolve(r) | ||
|
||
requestURL := r.URL.Path | ||
requestURL := urlPathTransformer.Transform(r) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line seems to break the invocation count bug
This prevented Prometheus metrics from being gathered from the URL. Signed-off-by: Alex Ellis (VMware) <[email protected]>
Derek add label: blocked |
Derek remove label: blocked |
Yes, looks good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good to me, no glaring holes that I can see.
Appreciated Lucas. |
@telackey do the upstream templates have the ability to pass on a path to their handlers yet? |
Description
Closes #789
Docker image for testing:
alexellis/gateway:http-paths