From 44dec87940d10d038c35eaac7a2f9418b27cd261 Mon Sep 17 00:00:00 2001 From: Trevor Royer Date: Wed, 29 May 2024 18:01:42 -0600 Subject: [PATCH] update reason if nil --- .../patch-inferenceservice-health-check.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/operators/openshift-gitops/instance/components/health-check-openshift-ai/patch-inferenceservice-health-check.yaml b/components/operators/openshift-gitops/instance/components/health-check-openshift-ai/patch-inferenceservice-health-check.yaml index 650ae563..c57ebbc5 100644 --- a/components/operators/openshift-gitops/instance/components/health-check-openshift-ai/patch-inferenceservice-health-check.yaml +++ b/components/operators/openshift-gitops/instance/components/health-check-openshift-ai/patch-inferenceservice-health-check.yaml @@ -18,17 +18,23 @@ message = condition.message end + if condition.reason == nil then + reason = "" + else + message = condition.reason + end + if condition.status == "Unknown" then progressing = true - msg = msg .. i .. ": " .. condition.type .. " | " .. condition.status .. " | " .. condition.reason .. " | " .. message .. "\n" + msg = msg .. i .. ": " .. condition.type .. " | " .. condition.status .. " | " .. reason .. " | " .. message .. "\n" elseif condition.status == "False" then if condition.type == "LatestDeploymentReady" then progressing = true else degraded = true end - msg = msg .. i .. ": " .. condition.type .. " | " .. condition.status .. " | " .. condition.reason .. " | " .. message .. "\n" + msg = msg .. i .. ": " .. condition.type .. " | " .. condition.status .. " | " .. reason .. " | " .. message .. "\n" end end