From b3c4722c47524036c9690e639547108fe8e01305 Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Fri, 23 Mar 2018 14:35:37 +0000 Subject: [PATCH] fix autoscaling down check when desiredcapacity == maxcapacity --- api/autoscaling.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/autoscaling.go b/api/autoscaling.go index 314f825..5f0439f 100644 --- a/api/autoscaling.go +++ b/api/autoscaling.go @@ -193,7 +193,7 @@ func (c *AutoscalingController) processEcsMessage(message ecs.SNSPayloadEcs) err } } // make scaling (down) decision - if desiredCapacity > minSize && resourcesFitGlobal { + if desiredCapacity > minSize && (resourcesFitGlobal || desiredCapacity == maxSize) { hasFreeResourcesGlobal := c.scaleDownDecision(clusterName, dc.ContainerInstances, registeredInstanceCpu, registeredInstanceMemory, cpuNeeded, memoryNeeded) if hasFreeResourcesGlobal { // check cooldown period