mirror of
https://github.com/openfaas/faas.git
synced 2025-06-18 20:16:37 +00:00
Extract scaling from zero
- extracting this package means it can be used in other components such as the asynchronous nats-queue-worker which may need to invoke functions which are scaled down to zero replicas. Ref: https://github.com/openfaas/nats-queue-worker/issues/32 Tested on Docker Swarm for scaling up, already scaled and not found error. Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
fb06e299cf
commit
9cea08c728
@ -8,7 +8,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/openfaas/faas-provider/auth"
|
||||
"github.com/openfaas/faas/gateway/handlers"
|
||||
"github.com/openfaas/faas/gateway/scaling"
|
||||
)
|
||||
|
||||
const fallbackValue = 120
|
||||
@ -70,11 +70,11 @@ func TestGetReplicasExistentFn(t *testing.T) {
|
||||
}))
|
||||
defer testServer.Close()
|
||||
|
||||
expectedSvcQryResp := handlers.ServiceQueryResponse{
|
||||
expectedSvcQryResp := scaling.ServiceQueryResponse{
|
||||
Replicas: 0,
|
||||
MaxReplicas: uint64(handlers.DefaultMaxReplicas),
|
||||
MinReplicas: uint64(handlers.DefaultMinReplicas),
|
||||
ScalingFactor: uint64(handlers.DefaultScalingFactor),
|
||||
MaxReplicas: uint64(scaling.DefaultMaxReplicas),
|
||||
MinReplicas: uint64(scaling.DefaultMinReplicas),
|
||||
ScalingFactor: uint64(scaling.DefaultScalingFactor),
|
||||
AvailableReplicas: 0,
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user