lib/hako/schedulers/ecs.rb in hako-0.25.0 vs lib/hako/schedulers/ecs.rb in hako-0.25.1
- old
+ new
@@ -763,10 +763,10 @@
def has_capacity?(task_definition, container_instances)
required_cpu, required_memory = task_definition.container_definitions.inject([0, 0]) { |(cpu, memory), d| [cpu + d.cpu, memory + d.memory] }
container_instances.any? do |ci|
cpu = ci.remaining_resources.find { |r| r.name == 'CPU' }.integer_value
memory = ci.remaining_resources.find { |r| r.name == 'MEMORY' }.integer_value
- required_cpu < cpu && required_memory < memory
+ required_cpu <= cpu && required_memory <= memory
end
end
# @param [Hash] definition
# @return [nil]