From 0e7fb2d4a6f8a23a2604b5905da1195a68e4a368 Mon Sep 17 00:00:00 2001 From: "Alex Ellis (OpenFaaS Ltd)" Date: Fri, 20 Sep 2019 21:49:28 +0100 Subject: [PATCH] Bump faas-provider to 0.10.1 Signed-off-by: Alex Ellis (OpenFaaS Ltd) --- Gopkg.lock | 10 +++++----- Gopkg.toml | 16 ++++++++-------- .../openfaas/faas-provider/logs/handler.go | 1 + .../github.com/openfaas/faas-provider/serve.go | 13 ++++++++----- .../openfaas/faas-provider/types/model.go | 9 ++++++++- 5 files changed, 30 insertions(+), 19 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index d7b1f25f..8dee346c 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -164,11 +164,11 @@ name = "github.com/openfaas/faas" packages = ["gateway/requests"] pruneopts = "UT" - revision = "df97efafae36ce7093ad353e3e6acc0e93d6300e" - version = "0.16.0" + revision = "0a90125aba339a8133009f215ed6d2d8c19277f8" + version = "0.17.4" [[projects]] - digest = "1:e595b78e3004db99c1f7a4eee13755b2420f06c0089b70c84cb73a7d73af21a2" + digest = "1:4d2aae011581a08fbac07ce852b5296984b12d9b8ea8bd71306353d43659ad16" name = "github.com/openfaas/faas-provider" packages = [ ".", @@ -179,8 +179,8 @@ "types", ] pruneopts = "UT" - revision = "a7f9772feb70aae25b0c4420dbb64ed31684c525" - version = "0.9.5" + revision = "ba3fa3b0ae00f0b9222851f3e03b2e6ea8672998" + version = "0.10.1" [[projects]] digest = "1:40e195917a951a8bf867cd05de2a46aaf1806c50cf92eebf4c16f78cd196f747" diff --git a/Gopkg.toml b/Gopkg.toml index eb039dc6..616f0c3e 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -3,20 +3,20 @@ unused-packages = true [[constraint]] - name = "github.com/docker/go-units" - version = "0.3.2" + name = "github.com/openfaas/faas" + version = "0.17.4" [[constraint]] - name = "github.com/gorilla/mux" - version = "1.6.0" + name = "github.com/openfaas/faas-provider" + version = "0.10.1" [[constraint]] - name = "github.com/openfaas/faas" - version = "0.16.0" + name = "github.com/docker/go-units" + version = "0.3.2" [[constraint]] - name = "github.com/openfaas/faas-provider" - version = "0.9.5" + name = "github.com/gorilla/mux" + version = "1.6.0" # match docker/distribution revision with moby [[override]] diff --git a/vendor/github.com/openfaas/faas-provider/logs/handler.go b/vendor/github.com/openfaas/faas-provider/logs/handler.go index 1a1cc35d..0ab10a02 100644 --- a/vendor/github.com/openfaas/faas-provider/logs/handler.go +++ b/vendor/github.com/openfaas/faas-provider/logs/handler.go @@ -115,6 +115,7 @@ func parseRequest(r *http.Request) (logRequest Request, err error) { return logRequest, err } } + // ignore error because it will default to false if we can't parse it logRequest.Follow, _ = strconv.ParseBool(getValue(query, "follow")) diff --git a/vendor/github.com/openfaas/faas-provider/serve.go b/vendor/github.com/openfaas/faas-provider/serve.go index b3f6d1b0..cabcfcc8 100644 --- a/vendor/github.com/openfaas/faas-provider/serve.go +++ b/vendor/github.com/openfaas/faas-provider/serve.go @@ -13,6 +13,9 @@ import ( "github.com/openfaas/faas-provider/types" ) +// NameExpression for a function / service +const NameExpression = "-a-zA-Z_0-9." + var r *mux.Router // Mark this as a Golang "package" @@ -55,17 +58,17 @@ func Serve(handlers *types.FaaSHandlers, config *types.FaaSConfig) { r.HandleFunc("/system/functions", handlers.DeleteHandler).Methods("DELETE") r.HandleFunc("/system/functions", handlers.UpdateHandler).Methods("PUT") - r.HandleFunc("/system/function/{name:[-a-zA-Z_0-9]+}", handlers.ReplicaReader).Methods("GET") - r.HandleFunc("/system/scale-function/{name:[-a-zA-Z_0-9]+}", handlers.ReplicaUpdater).Methods("POST") + r.HandleFunc("/system/function/{name:["+NameExpression+"]+}", handlers.ReplicaReader).Methods("GET") + r.HandleFunc("/system/scale-function/{name:["+NameExpression+"]+}", handlers.ReplicaUpdater).Methods("POST") r.HandleFunc("/system/info", handlers.InfoHandler).Methods("GET") r.HandleFunc("/system/secrets", handlers.SecretHandler).Methods(http.MethodGet, http.MethodPut, http.MethodPost, http.MethodDelete) r.HandleFunc("/system/logs", handlers.LogHandler).Methods(http.MethodGet) // Open endpoints - r.HandleFunc("/function/{name:[-a-zA-Z_0-9]+}", handlers.FunctionProxy) - r.HandleFunc("/function/{name:[-a-zA-Z_0-9]+}/", handlers.FunctionProxy) - r.HandleFunc("/function/{name:[-a-zA-Z_0-9]+}/{params:.*}", handlers.FunctionProxy) + r.HandleFunc("/function/{name:["+NameExpression+"]+}", handlers.FunctionProxy) + r.HandleFunc("/function/{name:["+NameExpression+"]+}/", handlers.FunctionProxy) + r.HandleFunc("/function/{name:["+NameExpression+"]+}/{params:.*}", handlers.FunctionProxy) if config.EnableHealth { r.HandleFunc("/healthz", handlers.HealthHandler).Methods("GET") diff --git a/vendor/github.com/openfaas/faas-provider/types/model.go b/vendor/github.com/openfaas/faas-provider/types/model.go index 888cfccd..ef65176c 100644 --- a/vendor/github.com/openfaas/faas-provider/types/model.go +++ b/vendor/github.com/openfaas/faas-provider/types/model.go @@ -46,6 +46,9 @@ type FunctionDeployment struct { // ReadOnlyRootFilesystem removes write-access from the root filesystem // mount-point. ReadOnlyRootFilesystem bool `json:"readOnlyRootFilesystem"` + + // Namespace for the function to be deployed into + Namespace string `json:"namespace,omitempty"` } // FunctionResources Memory and CPU @@ -72,7 +75,8 @@ type FunctionStatus struct { // EnvProcess is the process to pass to the watchdog, if in use EnvProcess string `json:"envProcess"` - // AvailableReplicas is the count of replicas ready to receive invocations as reported by the backend + // AvailableReplicas is the count of replicas ready to receive + // invocations as reported by the backend AvailableReplicas uint64 `json:"availableReplicas"` // Labels are metadata for functions which may be used by the @@ -82,6 +86,9 @@ type FunctionStatus struct { // Annotations are metadata for functions which may be used by the // backend for management, orchestration, events and build tasks Annotations *map[string]string `json:"annotations"` + + // Namespace where the function can be accessed + Namespace string `json:"namespace,omitempty"` } // Secret for underlying orchestrator