github.com/argoproj/argo-cd/v3@v3.2.1/resource_customizations/keda.sh/ScaledObject/health.lua (about) 1 local hs = {} 2 local healthy = false 3 local degraded = false 4 local suspended = false 5 if obj.status ~= nil then 6 if obj.status.conditions ~= nil then 7 for i, condition in ipairs(obj.status.conditions) do 8 if condition.status == "False" and condition.type == "Ready" then 9 hs.message = condition.message 10 degraded = true 11 end 12 if condition.status == "True" and condition.type == "Ready" then 13 hs.message = condition.message 14 healthy = true 15 end 16 if condition.status == "True" and condition.type == "Paused" then 17 hs.message = condition.message 18 suspended = true 19 end 20 if condition.status == "True" and condition.type == "Fallback" then 21 hs.message = condition.message 22 degraded = true 23 end 24 end 25 end 26 end 27 if degraded == true then 28 hs.status = "Degraded" 29 return hs 30 elseif healthy == true and suspended == false then 31 hs.status = "Healthy" 32 return hs 33 elseif healthy == true and suspended == true then 34 hs.status = "Suspended" 35 return hs 36 end 37 hs.status = "Progressing" 38 hs.message = "Creating HorizontalPodAutoscaler Object" 39 return hs