Class: Runners::Kubernetes::CreateExecutionInfo

Inherits:
Object
  • Object
show all
Defined in:
app/services/runners/kubernetes/create_execution_info.rb

Constant Summary collapse

ERROR_REASONS =
%w[
  ImagePullBackOff
  ErrImagePull
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#podObject (readonly)

Returns the value of attribute pod.



6
7
8
# File 'app/services/runners/kubernetes/create_execution_info.rb', line 6

def pod
  @pod
end

Instance Method Details

#perform(pod:) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/services/runners/kubernetes/create_execution_info.rb', line 13

def perform(pod:)
  @pod = pod

  Runners::ExecutionInfo.new(
    id: pod&.&.name,
    status: status,
    exit_code: exit_code,
    started_at: started_at,
    finished_at: finished_at,
    error: error_message,
    schedule_pending: schedule_pending?
  )
end