github.com/argoproj/argo-cd/v3@v3.2.1/resource_customizations/ocs.openshift.io/StorageCluster/health.lua (about) 1 local hs_degraded = {} 2 local hs_progressing = {} 3 local hs_healthy = {} 4 local is_degraded = false 5 local is_progressing = false 6 local is_healthy = false 7 if obj ~= nil and obj.status ~= nil and obj.status.conditions ~= nil then 8 for _, condition in pairs(obj.status.conditions) do 9 if condition.type == "Degraded" and condition.status == "True" then 10 is_degraded = true 11 hs_degraded.status = "Degraded" 12 hs_degraded.message = condition.message 13 elseif condition.type == "Progressing" and condition.status == "True" then 14 is_progressing = true 15 hs_progressing.status = "Progressing" 16 hs_progressing.message = condition.message 17 elseif condition.type == "Available" and condition.status == "True" then 18 is_healthy = true 19 hs_healthy.status = "Healthy" 20 hs_healthy.message = condition.message 21 end 22 end 23 end 24 if is_degraded then 25 return hs_degraded 26 elseif is_progressing then 27 return hs_progressing 28 elseif is_healthy then 29 return hs_healthy 30 end 31 return { status = "Unknown", message = "StorageCluster is in an unknown state." }