Class: Kubernetes::PodStatus
- Inherits:
-
Object
- Object
- Kubernetes::PodStatus
- Defined in:
- lib/kubernetes/pod_status.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#phase ⇒ Object
readonly
Returns the value of attribute phase.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Instance Method Summary collapse
- #failed? ⇒ Boolean
-
#initialize(data) ⇒ PodStatus
constructor
A new instance of PodStatus.
- #pending? ⇒ Boolean
- #running? ⇒ Boolean
- #succeeded? ⇒ Boolean
Constructor Details
#initialize(data) ⇒ PodStatus
Returns a new instance of PodStatus.
7 8 9 10 11 12 13 14 |
# File 'lib/kubernetes/pod_status.rb', line 7 def initialize(data) @phase = data.fetch("phase") @message = data.fetch("message", nil) @reason = data.fetch("reason", nil) @host_ip = data.fetch("hostIP", nil) @pod_ip = data.fetch("podIP", nil) @start_time = data.key?("startTime") && Time.iso8601(data.fetch("startTime")) end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
5 6 7 |
# File 'lib/kubernetes/pod_status.rb', line 5 def @message end |
#phase ⇒ Object (readonly)
Returns the value of attribute phase.
5 6 7 |
# File 'lib/kubernetes/pod_status.rb', line 5 def phase @phase end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
5 6 7 |
# File 'lib/kubernetes/pod_status.rb', line 5 def reason @reason end |
Instance Method Details
#failed? ⇒ Boolean
28 29 30 |
# File 'lib/kubernetes/pod_status.rb', line 28 def failed? @phase == "Failed" end |
#pending? ⇒ Boolean
16 17 18 |
# File 'lib/kubernetes/pod_status.rb', line 16 def pending? @phase == "Pending" end |
#running? ⇒ Boolean
20 21 22 |
# File 'lib/kubernetes/pod_status.rb', line 20 def running? @phase == "Running" end |
#succeeded? ⇒ Boolean
24 25 26 |
# File 'lib/kubernetes/pod_status.rb', line 24 def succeeded? @phase == "Succeeded" end |