Class: Rhea::Kubernetes::Commands::Reschedule
- Defined in:
- lib/rhea/kubernetes/commands/reschedule.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
Instance Method Summary collapse
-
#initialize(command_attributes) ⇒ Reschedule
constructor
A new instance of Reschedule.
- #perform ⇒ Object
Constructor Details
#initialize(command_attributes) ⇒ Reschedule
Returns a new instance of Reschedule.
7 8 9 |
# File 'lib/rhea/kubernetes/commands/reschedule.rb', line 7 def initialize(command_attributes) self.command = Command.new(command_attributes) end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
5 6 7 |
# File 'lib/rhea/kubernetes/commands/reschedule.rb', line 5 def command @command end |
Instance Method Details
#perform ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/rhea/kubernetes/commands/reschedule.rb', line 11 def perform command_attributes = command.attributes.slice(:image, :expression) controller = Get.new(command_attributes).perform process_count = controller.process_count Scale.new(command_attributes.merge(process_count: 0)).perform Scale.new(command_attributes.merge(process_count: process_count)).perform end |