Skip to content

Commit

Permalink
Fix bug of not considering min replicas all the time
Browse files Browse the repository at this point in the history
replica_diff should be computed on adjusted desired replicas
which is different than desired replicas in case min/max limits
are hit.
  • Loading branch information
hammady committed Nov 30, 2017
1 parent 29727a0 commit bd7afa3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/scaltainer/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/scaltainer/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Scaltainer
VERSION = "0.1.4"
VERSION = "0.1.5"
end

0 comments on commit bd7afa3

Please sign in to comment.