Class: Gitlab::Kubernetes::Pod
- Inherits:
-
Object
- Object
- Gitlab::Kubernetes::Pod
- Defined in:
- lib/gitlab/kubernetes/pod.rb
Constant Summary collapse
- PENDING =
'Pending'
- RUNNING =
'Running'
- SUCCEEDED =
'Succeeded'
- FAILED =
'Failed'
- UNKNOWN =
'Unknown'
- PHASES =
[PENDING, RUNNING, SUCCEEDED, FAILED, UNKNOWN].freeze
- STABLE_TRACK_VALUE =
'stable'
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Pod
constructor
A new instance of Pod.
- #name ⇒ Object
- #order ⇒ Object
- #stable? ⇒ Boolean
- #status ⇒ Object
- #track ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Pod
Returns a new instance of Pod.
15 16 17 |
# File 'lib/gitlab/kubernetes/pod.rb', line 15 def initialize(attributes = {}) @attributes = attributes end |
Instance Method Details
#name ⇒ Object
23 24 25 |
# File 'lib/gitlab/kubernetes/pod.rb', line 23 def name ['name'] || ['generateName'] end |
#order ⇒ Object
35 36 37 |
# File 'lib/gitlab/kubernetes/pod.rb', line 35 def order stable? ? 1 : 0 end |
#stable? ⇒ Boolean
27 28 29 |
# File 'lib/gitlab/kubernetes/pod.rb', line 27 def stable? track == STABLE_TRACK_VALUE end |
#status ⇒ Object
31 32 33 |
# File 'lib/gitlab/kubernetes/pod.rb', line 31 def status attributes.dig('status', 'phase') end |
#track ⇒ Object
19 20 21 |
# File 'lib/gitlab/kubernetes/pod.rb', line 19 def track attributes.dig('metadata', 'labels', 'track') || STABLE_TRACK_VALUE end |