From 4815d8fdc737df9ba2c89ca4618531c089e26bc8 Mon Sep 17 00:00:00 2001 From: Jonathan Gnagy Date: Sat, 5 Jan 2019 11:47:34 -0700 Subject: [PATCH 1/2] Forcing AvailableReplicas to be Replicas Signed-off-by: Jonathan Gnagy --- handlers/replicas.go | 2 ++ vendor/github.com/alexellis/faas/gateway/requests/requests.go | 3 +++ 2 files changed, 5 insertions(+) diff --git a/handlers/replicas.go b/handlers/replicas.go index a9ce937..4af805e 100644 --- a/handlers/replicas.go +++ b/handlers/replicas.go @@ -85,6 +85,8 @@ func MakeReplicaReader(client rancher.BridgeClient) VarsHandler { return } + found.AvailableReplicas = found.Replicas + functionBytes, _ := json.Marshal(found) w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) diff --git a/vendor/github.com/alexellis/faas/gateway/requests/requests.go b/vendor/github.com/alexellis/faas/gateway/requests/requests.go index 0701fbd..4d1dfa4 100644 --- a/vendor/github.com/alexellis/faas/gateway/requests/requests.go +++ b/vendor/github.com/alexellis/faas/gateway/requests/requests.go @@ -60,6 +60,9 @@ type Function struct { InvocationCount float64 `json:"invocationCount"` // TODO: shouldn't this be int64? Replicas uint64 `json:"replicas"` EnvProcess string `json:"envProcess"` + + // AvailableReplicas is the count of replicas ready to receive invocations as reported by the back-end + AvailableReplicas uint64 `json:"availableReplicas"` } // AsyncReport is the report from a function executed on a queue worker. From 3fdbe8067679404306bef36fa1a8b1c810ec65ce Mon Sep 17 00:00:00 2001 From: Jonathan Gnagy Date: Sat, 5 Jan 2019 11:48:34 -0700 Subject: [PATCH 2/2] adding .DEREK.yml back Signed-off-by: Jonathan Gnagy --- .DEREK.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .DEREK.yml diff --git a/.DEREK.yml b/.DEREK.yml new file mode 100644 index 0000000..8f544aa --- /dev/null +++ b/.DEREK.yml @@ -0,0 +1 @@ +redirect: https://raw.githubusercontent.com/openfaas/faas/master/.DEREK.yml