class Rhea::Kubernetes::Commands::Redeploy

Attributes

command[RW]

Public Class Methods

new(command_attributes) click to toggle source
# File lib/rhea/kubernetes/commands/redeploy.rb, line 7
def initialize(command_attributes)
  self.command = Command.new(command_attributes)
end

Public Instance Methods

perform() click to toggle source
# File lib/rhea/kubernetes/commands/redeploy.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
  Delete.new(command_attributes).perform
  Scale.new(command_attributes.merge(process_count: process_count)).perform
end