Based on the received feedback I updated the documentation of the function. Also replaced variable temp by an more declaritive variable.
Signed-off-by: Simon Pelczer <templum.dev@gmail.com>
Further I created some unit test which should cover all relevant scenarios for the created function.
Signed-off-by: Simon Pelczer <templum.dev@gmail.com>
Introduced an new label to set the scaling factor that is used to calculate th proportions, setting it to 0 also allows to disable scaling.
Updated the tests to reflect the changes and added a new test which shows that setting the scaling factor to 0 indeed does disable scaling.
Ensured that the scaling factor is always between [0 and 100].
Signed-off-by: Simon Pelczer <templum.dev@gmail.com>
Fixed the UI so that when an error occurs, the tab automatically changes
to the manual tab in order to show the errors.
Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
The unit tests were inside the `gateway/tests` directory which had no
effect to the coverage for `go test`. Therefore, moved the tests inside
the same directory as the test target.
Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
Routeless proxy allowed no HTTP path to be given when a Header
X-Function: name was given. This has been deprecated - I am
unaware of any usage of the feature.
Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
Get is a supported method so this test failed, I've now changed
this to an unsupported method - i.e. HEAD to trigger the error
and keep the test.
Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
Update the NodeInfo sample function to use latest
watchdog version (0.7.7) to support both GET and POST method.
Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
Proxy body was being passed correctly due to placement of defer
statement. This has been moved into outer scope to resolve issue.
Tested with new e2e tests in certifier component.
Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
HTTP proxy was not passing query-string upstream. This change
reinstates the behaviour through TDD - adding test coverage and
automated regression testing.
Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
Forwarded requests were being logged in the function metrics and
I saw this when doing some testing on auto-scaling with K8s.
This change removes the call to the Prometheus notifier for any
calls which are forwarded to the provider and retains them for the
functions.
Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
If the watchdog is sent SIGTERM from an external process then it
should stop accepting new connections and attempt to finish the
work in progress. This change makes use of the new ability in Go
1.9 and onwards to cancel a HTTP server gracefully.
The write_timeout duration is used as a grace period to allow all
in-flight requests to complete. The pattern is taken directly from
the offical example in the Golang documentation. [1]
Further tuning and testing may be needed for Windows containers which
have a different set of signals for closing work. This change aims
to cover the majority use-case for Linux containers.
The HTTP health-check is also invalidated by creating an and
expression with the existing lock file.
Tested with Kubernetes by deploying a custom watchdog and the
fprocess of `env`. Log message was observed when scaling down and
connections stopped being accepted on terminating replica.
Also corrects some typos from previous PR.
[1] https://golang.org/pkg/net/http/#Server.Shutdown
Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
0.7.7 allows direct function access bypassing the provider - this makes
the throughput increase and skips a HTTP hop that is no longer required.
Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
window.crypto is throwing an error on IE11
which required a modification to use window.msCrypto
instead in case of running on IE11
Signed-off-by: Ivana Yovcheva <iyovcheva@vmware.com>
Added blog post, podcast episode, 3 speaking engagements, and author to a 2017 blog/podcast row to fix formatting.
Signed-off-by: John Callaway <john@1north.com>