From bd7afa35d3ad4b34b9df95c03ed3a2619e5867b1 Mon Sep 17 00:00:00 2001 From: Hossam Hammady Date: Thu, 30 Nov 2017 14:55:49 +0300 Subject: [PATCH] Fix bug of not considering min replicas all the time replica_diff should be computed on adjusted desired replicas which is different than desired replicas in case min/max limits are hit. --- lib/scaltainer/runner.rb | 2 +- lib/scaltainer/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/scaltainer/runner.rb b/lib/scaltainer/runner.rb index ee32806..3ba81e0 100644 --- a/lib/scaltainer/runner.rb +++ b/lib/scaltainer/runner.rb @@ -98,7 +98,7 @@ def process_service(service_name, config, state, prefix, type, metrics) @logger.debug "Desired number of replicas for service #{service_name} is #{desired_replicas}" adjusted_replicas = type.adjust_desired_replicas(desired_replicas, config) @logger.debug "Desired number of replicas for service #{service_name} is adjusted to #{adjusted_replicas}" - replica_diff = desired_replicas - current_replicas + replica_diff = adjusted_replicas - current_replicas type.yield_to_scale(replica_diff, config, state, metric, service_name, @logger) do scale_out service, current_replicas, adjusted_replicas diff --git a/lib/scaltainer/version.rb b/lib/scaltainer/version.rb index 1ead7e1..72a1a9c 100644 --- a/lib/scaltainer/version.rb +++ b/lib/scaltainer/version.rb @@ -1,3 +1,3 @@ module Scaltainer - VERSION = "0.1.4" + VERSION = "0.1.5" end