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 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.