github.com/argoproj/argo-cd/v3@v3.2.1/resource_customizations/projectcontour.io/HTTPProxy/health.lua (about) 1 -- Status reporting information detailed here 2 -- https://projectcontour.io/docs/main/config/fundamentals/#status-reporting 3 -- More HTTPProxy status conditions api information here: https://projectcontour.io/docs/v1.9.0/api/#projectcontour.io/v1.HTTPProxyStatus 4 5 hs = { 6 status = "Progressing", 7 message = "Waiting for status", 8 } 9 10 if obj.status then 11 if obj.status.conditions then 12 for _, cond in ipairs(obj.status.conditions) do 13 if obj.metadata.generation == cond.observedGeneration then -- This must match so that we don't report a resource as healthy even though its status is stale 14 if cond.type == "Valid" and cond.status == "True" then -- Contour will update a single condition, Valid, that is in normal-true polarity. That is, when currentStatus is valid, the Valid condition will be status: true, and vice versa. 15 hs.status = "Healthy" 16 hs.message = obj.status.description 17 return hs 18 elseif cond.type == "Valid" and cond.status == "False" then 19 hs.status = "Degraded" 20 hs.message = obj.status.description 21 return hs 22 end 23 end 24 end 25 elseif obj.status.currentStatus then -- Covers any state where conditions are absent (thus no observedGeneration) but currentStatus is present such as NotReconciled or future similar cases. 26 hs.message = obj.status.description 27 end 28 end 29 30 return hs