Closed krmard closed 4 years ago
I face the exact same issue. Applying the fix like the recommend above works. Please create a PR to fix it.
I have a better solution, that change line 120 from
pod_stamp = Time.parse(pod.status.startTime)
to
if pod.status.phase == 'Pending' pod_stamp = Time.parse(pod.metadata.creationTimestamp) else pod_stamp = Time.parse(pod.status.startTime) end
I've seen the same exception when there are POD's in pending state. Tested the fix proposed above and it works well in my environment. Prepared a PR: #98
this should be fixed in https://rubygems.org/gems/sensu-plugins-kubernetes/versions/4.0.1
A master with multiple nodes. When any new pod cannot start right away and gets in a Pending state the check fails with following error:
The part which breaks is
If the pod is in a Pending state it doesn't have a startTime.
Possible fix
Skip the check if pod.status.phase is Pending: