class Rhea::Kubernetes::Commands::Base

Constants

NAMESPACE

Private Instance Methods

api() click to toggle source
# File lib/rhea/kubernetes/commands/base.rb, line 9
def api
  @api ||= Rhea::Kubernetes::Api.new
end
controller_to_command(controller) click to toggle source
# File lib/rhea/kubernetes/commands/base.rb, line 13
def controller_to_command(controller)
  expression = controller.spec.template.metadata.annotations.try(:rhea_command)
  return if expression.nil?
  process_count = controller.status.replicas
  image = controller.spec.template.spec.containers.first.image
  Command.new(
    expression: expression,
    image: image,
    process_count: process_count,
    created_at: Time.parse(controller.metadata.creationTimestamp)
  )
end