github.com/argoproj/argo-cd/v2@v2.10.9/resource_customizations/cluster.x-k8s.io/Machine/health.lua (about) 1 function getStatusBasedOnPhase(obj) 2 local hs = {} 3 hs.status = "Progressing" 4 hs.message = "Waiting for machines" 5 if obj.status ~= nil and obj.status.phase ~= nil then 6 if obj.status.phase == "Running" then 7 hs.status = "Healthy" 8 hs.message = "Machine is running" 9 end 10 if obj.status.phase == "Failed" then 11 hs.status = "Degraded" 12 hs.message = "" 13 end 14 end 15 return hs 16 end 17 18 function getReadyContitionMessage(obj) 19 if obj.status ~= nil and obj.status.conditions ~= nil then 20 for i, condition in ipairs(obj.status.conditions) do 21 if condition.type == "Ready" and condition.status == "False" then 22 return condition.message 23 end 24 end 25 end 26 return "Condition is unknown" 27 end 28 29 local hs = getStatusBasedOnPhase(obj) 30 if hs.status ~= "Healthy" then 31 hs.message = getReadyContitionMessage(obj) 32 end 33 34 return hs