github.com/argoproj/argo-cd/v2@v2.10.9/resource_customizations/operator.knative.dev/KnativeEventing/health.lua (about) 1 local health_status = {} 2 if obj.status ~= nil then 3 if obj.status.conditions ~= nil then 4 local numTrue = 0 5 local numFalse = 0 6 local msg = "" 7 for i, condition in pairs(obj.status.conditions) do 8 msg = msg .. i .. ": " .. condition.type .. " | " .. condition.status .. "\n" 9 if condition.type == "Ready" and condition.status == "True" then 10 numTrue = numTrue + 1 11 elseif condition.type == "InstallSucceeded" and condition.status == "True" then 12 numTrue = numTrue + 1 13 elseif condition.type == "Ready" and condition.status == "False" then 14 numFalse = numFalse + 1 15 elseif condition.status == "Unknown" then 16 numFalse = numFalse + 1 17 end 18 end 19 if(numFalse > 0) then 20 health_status.message = msg 21 health_status.status = "Progressing" 22 return health_status 23 elseif(numTrue == 2) then 24 health_status.message = "KnativeEventing is healthy." 25 health_status.status = "Healthy" 26 return health_status 27 else 28 health_status.message = msg 29 health_status.status = "Degraded" 30 return health_status 31 end 32 end 33 end 34 health_status.status = "Progressing" 35 health_status.message = "Waiting for KnativeEventing" 36 return health_status