From a9ae76a5465e59dd1c3bbab8fb575d5f7773b5b3 Mon Sep 17 00:00:00 2001 From: Manish Kumar <30774250+manish-jangra@users.noreply.github.com> Date: Fri, 25 Aug 2023 19:00:32 +0530 Subject: [PATCH] Fix for Syntax Error in Sample Code Snippet --- charts/operators-installer/README.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/charts/operators-installer/README.md b/charts/operators-installer/README.md index aa34bc39..5983a766 100644 --- a/charts/operators-installer/README.md +++ b/charts/operators-installer/README.md @@ -47,17 +47,18 @@ Here is a sample updated health check to use which if the InstallPlan is set to health_status = {} if obj.status ~= nil then if obj.status.conditions ~= nil then - numDegraded = 0 - numPending = 0 - msg = "" - for i, condition in pairs(obj.status.conditions) do - msg = msg .. i .. ": " .. condition.type .. " | " .. condition.status .. "\n" - if condition.type == "InstallPlanPending" and condition.status == "True" then - numPending = numPending + 1 - elseif (condition.type == "InstallPlanMissing" and condition.reason ~= "ReferencedInstallPlanNotFound") then - numDegraded = numDegraded + 1 - elseif (condition.type == "CatalogSourcesUnhealthy" or condition.type == "InstallPlanFailed" or condition.type == "ResolutionFailed") and condition.status == "True" then - numDegraded = numDegraded + 1 + numDegraded = 0 + numPending = 0 + msg = "" + for i, condition in pairs(obj.status.conditions) do + msg = msg .. i .. ": " .. condition.type .. " | " .. condition.status .. "\n" + if condition.type == "InstallPlanPending" and condition.status == "True" then + numPending = numPending + 1 + elseif (condition.type == "InstallPlanMissing" and condition.reason ~= "ReferencedInstallPlanNotFound") then + numDegraded = numDegraded + 1 + elseif (condition.type == "CatalogSourcesUnhealthy" or condition.type == "InstallPlanFailed" or condition.type == "ResolutionFailed") and condition.status == "True" then + numDegraded = numDegraded + 1 + end end end if numDegraded == 0 and numPending == 0 then