Skip to content

Commit

Permalink
Fix for Syntax Error in Sample Code Snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
manish-jangra committed Aug 25, 2023
1 parent 756c9b6 commit a9ae76a
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions charts/operators-installer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a9ae76a

Please sign in to comment.