Class: Dapp::Kube::Kubernetes::Client::Resource::Job

Inherits:
Base
  • Object
show all
Defined in:
lib/dapp/kube/kubernetes/client/resource/job.rb

Instance Attribute Summary

Attributes inherited from Base

#spec

Instance Method Summary collapse

Methods inherited from Base

#annotations, #initialize, #metadata, #name, #status

Constructor Details

This class inherits a constructor from Dapp::Kube::Kubernetes::Client::Resource::Base

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


13
14
15
16
17
# File 'lib/dapp/kube/kubernetes/client/resource/job.rb', line 13

def failed?
  !!spec.fetch('status', {}).fetch('conditions', []).find do |cond|
    cond['type'] == 'Failed'
  end
end

#succeeded?Boolean

Returns:

  • (Boolean)


19
20
21
22
23
# File 'lib/dapp/kube/kubernetes/client/resource/job.rb', line 19

def succeeded?
  !!spec.fetch('status', {}).fetch('conditions', []).find do |cond|
    cond['type'] == 'Complete'
  end
end

#terminated?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/dapp/kube/kubernetes/client/resource/job.rb', line 9

def terminated?
  failed? || succeeded?
end

#uidObject



5
6
7
# File 'lib/dapp/kube/kubernetes/client/resource/job.rb', line 5

def uid
  spec.fetch('metadata', {})['uid']
end