41 Commits

Author SHA1 Message Date
Ken Fukuyama
e6a6aea422 Moved unit test files inside same directory as test target
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>
2018-04-06 14:13:14 +01:00
Alex Ellis (VMware)
daa79aef75 Deprecate routeless proxy test
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>
2018-04-03 17:55:44 +01:00
Alex Ellis (VMware)
5e0569f75a Update TestGet_Rejected
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>
2018-04-03 17:55:44 +01:00
John McCabe
fac3345668 Use http package consts for http methods
This commit replaces occurences of http method strings with the
corresponding consts from the http package.

*Note* UPDATE is not strictly speaking a valid method and as such isn't
part of the http package (should be a PUT or PATCH?)

Signed-off-by: John McCabe <john@johnmccabe.net>
2018-03-23 16:37:33 +00:00
Alex Ellis
0c7e59fe8a Add direct_functions mode to gateway for tuning
Adds a pair of configuration options for performance tuning. The
gateway can now invoke functions directly and can bypass the
provider. See updated table in README.md for configuration values.

BaseURLResolver is added with unit tests that decouples resolving
upstream URL from the reverse proxy client code.

- SingleHostBaseURLResolver resolves a single upstream host
- FunctionAsHostBaseURLResolver resolves host based upon conventions
within the URL of the request to a function for direct access

Tested with Kubernetes (faas-netes) and faas-swarm through UI, CLI
calling system endpoints and functions directly.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-03-23 16:35:37 +00:00
Vivek Singh
b12a4d0bf2 adds Go durations for timeout configs
Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>

applied go fmt on config_test file

Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>

removes extra line in config_test

Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
2018-02-10 18:46:23 +00:00
Alex Ellis
f954bf0733 Merge master into breakout_swarm
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-02-01 09:29:54 +00:00
Eric Stoekl
4d785c8dfb Remove Content-Type forwarding from Request
Signed-off-by: Eric Stoekl <ems5311@gmail.com>
2017-12-16 16:04:20 +00:00
Alex Ellis
23a7187435 Refactoring: variable names, adding tests and http constants
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-05 06:50:08 -06:00
Alex Ellis
2452fdea0b Allow min-scale
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-05 06:50:08 -06:00
Alex Ellis
b17838ce51 Add Swarm limits
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-11-15 08:42:00 +00:00
Alex Ellis
b2c579370a Return labels in functions list endpoint
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-11-05 20:11:47 +00:00
Alex Ellis
4889c779b7 Verify prometheus results are mixed into function list
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-10-29 15:21:23 +00:00
Alex Ellis
8363532751 Set content-type for mixed-in Prometheus results
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-10-29 15:21:23 +00:00
Alex Young
0248a5ea1d Return 500 if GET /system/functions fails
Signed-off-by: Alex Young <alex@heuris.io>
2017-10-27 15:38:03 +01:00
Alex Ellis
12a0c75e91 Add unit tests to build. Pin to specific Alpine tag.
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-10-26 21:02:50 +01:00
Alex Ellis
520a6b05a1 Commit unit tests for content-type order
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-10-20 22:47:30 +02:00
Alex Ellis
dde98eb582 Forward path and query string through proxy
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-10-11 18:57:00 +01:00
John McCabe
89878f0c8a Migrate from alexellis org to openfaas
Note, not all `alexellis/github` references should be changed, there are
a number of repos which are not part of the openfaas org, this commit
excludes those.

Signed-off-by: John McCabe <john@johnmccabe.net>
2017-10-04 09:18:06 +01:00
Alex Ellis
ca9a7fe97c Reinstating tests
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-09-23 20:42:13 +01:00
Alex Ellis
2229e922d7 Add update endpoint/route
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-09-23 20:42:13 +01:00
Alex Young
84ae82473c Use types from requests
Signed-off-by: Alex Young <alex@heuris.io>
2017-09-22 14:39:01 +01:00
Alex Young
403236610a Remove duplication from createfunction_test.go
Signed-off-by: Alex Young <alex@heuris.io>
2017-09-22 14:39:01 +01:00
Alex Young
031a0bc18c Add tests around error handing done in #196
Signed-off-by: Alex Young <alex@heuris.io>
2017-09-22 14:39:01 +01:00
Alex Ellis
5339fdcdbe Query Prometheus API for stats.
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-09-07 22:42:27 +01:00
Alex
35a15cff01 Support external URL for FaaS functions 2017-08-08 09:14:46 +01:00
leigh schrandt
cc3308a555 Relocate config_test to tests package and
Export struct members of GatewayConfig{}
2017-07-18 08:46:46 +01:00
Sebastien Guilloux
9e711b3b5d Handle private docker registry auth
This adds support for private docker registries, by adding
an optional `registryAuth` field in the CreateFunctionRequest.
Auth must be passed as base64-encoded basic auth, similar to
how done in Docker file store credentials (~/.docker/config.json).
Credentials are then passed to swarm at service creation.
2017-05-30 17:10:34 +01:00
Alex
569ccbf323 Add license into code files for MIT 2017-04-27 23:21:50 +01:00
Alex Ellis
78af82021f Vendoring with Glide and delete function handler 2017-04-27 09:29:14 +01:00
Alex Ellis
3aec97441e Cleanup logging, give not allowed to GET on gateway functions 2017-04-05 22:34:45 +01:00
Alex
873d7a69e9 Remove test temporarily for gateway 2017-03-31 20:40:25 +01:00
Alex
c705cd8e33 Forward client HTTP headers through pipeline 2017-03-31 20:40:25 +01:00
Alex Ellis
2aeadfda1c Disable KeepAlive on proxy (#21)
* Service lookup

* Disable KeepAlive to force RR for replias.

* set KeepAlive to 0

* Remove temporary file

* Support white and rename function

* Remove debug from node sample
2017-03-21 08:39:36 +00:00
Alex
98c9ef67f4 Initial pop-up for new function. 2017-03-12 12:56:53 +00:00
Alex Ellis
9f2183f6f3 Update test names 2017-02-21 19:09:11 +00:00
Alex
c211ba0d07 Cover replica scaling with tests. 2017-01-30 21:16:54 +00:00
Alex
42c0c02950 Add integration test and defer 2017-01-27 21:07:09 +00:00
Alex Ellis
501e813d41 Move handlers into ./handlers 2017-01-25 22:29:17 +00:00
Alex Ellis
cf2317696d Unmarshall the service name 2017-01-22 11:13:45 +00:00
Alex Ellis
158c412251 Initial test for alert unmarshall 2017-01-22 11:09:43 +00:00