github.com/argoproj/argo-cd/v2@v2.10.9/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/health.lua (about) 1 local adopted = { status = "Unknown" } 2 local advertised = { status = "Unknown" } 3 local discovered = { status = "Unknown" } 4 5 if obj.status ~= nil then 6 if obj.status.conditions ~= nil then 7 for i, c in ipairs(obj.status.conditions) do 8 if c.type == "Adopted" then 9 adopted = c 10 elseif c.type == "Advertised" then 11 advertised = c 12 elseif c.type == "Discoverable" then 13 discovered = c 14 end 15 end 16 end 17 end 18 19 if adopted.status == "False" then 20 return { status = "Degraded", message = adopted.message } 21 elseif advertised.reason == "AdvertiseError" or advertised.reason == "UnadvertiseError" then 22 return { status = "Degraded", message = advertised.message } 23 elseif discovered.reason == "DiscoveryError" then 24 return { status = "Unknown", message = discovered.message } 25 elseif discovered.status == "True" then 26 return { status = "Healthy", message = discovered.message } 27 else 28 return { status = "Progressing", message = discovered.message } 29 end