From 85f3be4c235da8cc4b20ebeafed47a827ad7f6bf Mon Sep 17 00:00:00 2001 From: Vishwanath Narasimhan Date: Tue, 27 Nov 2018 11:15:31 -0800 Subject: [PATCH] Fixing a bug where we were crashing due to container statuses not present when not was lost --- source/code/plugin/in_kube_podinventory.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/code/plugin/in_kube_podinventory.rb b/source/code/plugin/in_kube_podinventory.rb index 2cd1e1bc3..ec76bac61 100644 --- a/source/code/plugin/in_kube_podinventory.rb +++ b/source/code/plugin/in_kube_podinventory.rb @@ -101,7 +101,7 @@ def parse_and_emit_records(podInventory, serviceList) #podStatus # the below is for accounting 'NodeLost' scenario, where-in the pod(s) in the lost node is still being reported as running podReadyCondition = true - if !items['status']['reason'].nil? && items['status']['reason'] == "NodeLost" + if !items['status']['reason'].nil? && items['status']['reason'] == "NodeLost" && !items['status']['conditions'].nil? items['status']['conditions'].each do |condition| if condition['type'] == "Ready" && condition['status'] == "False" podReadyCondition = false