class DTK::CrdParser::ExecutableAction

Attributes

bash_script[R]
entrypoint[R]
name[R]
type[R]

Public Class Methods

new(params) click to toggle source
# File lib/crd_parser/action/executable_action.rb, line 6
def initialize(params)
  @name = params[:name]
  @entrypoint = params[:entrypoint]
  @type = params[:type]
  @bash_script = params[:bash_script]
end

Private Class Methods

create_from_kube(client, component_instance, component_name) click to toggle source
# File lib/crd_parser/action/executable_action.rb, line 15
def self.create_from_kube(client, component_instance, component_name)
  component_obj = Component.create_from_kube(client, component_instance, component_name)
  actions = component_obj.component_def.executable_actions
  executable_actions = Hash.new
  if actions
    actions.to_hash.each do |name, action|
      params = {
        name: name.to_s,
        entrypoint: action[:entrypoint] || "",
        type: action[:type] || "",
        bash_script: action[:bash_script] || ""
      }
      executable_actions[name.to_sym] = ExecutableAction.new(params)
    end
  end
  executable_actions
end