github.com/argoproj/argo-cd/v3@v3.2.1/resource_customizations/capabilities.3scale.net/Product/health.lua (about)

     1  local hs = {}
     2  
     3  if obj.status ~= nil and obj.status.conditions ~= nil then
     4    for _, condition in ipairs(obj.status.conditions) do
     5      if condition.status ~= "True" then goto continue end
     6  
     7      if condition.type == "Synced" then
     8        hs.status = "Healthy"
     9        hs.message = "3scale Product is synced"
    10        return hs
    11      elseif condition.type == "Invalid" then
    12        hs.status = "Degraded"
    13        hs.message = condition.message or "3scale Product configuration is invalid"
    14        return hs
    15      elseif condition.type == "Orphan" then
    16        hs.status = "Degraded"
    17        hs.message = condition.message or "3scale Product references non-existing resources"
    18        return hs
    19      elseif condition.type == "Failed" then
    20        hs.status = "Degraded"
    21        hs.message = condition.message or "3scale Product synchronization failed"
    22        return hs
    23      end
    24  
    25      ::continue::
    26    end
    27  end
    28  
    29  hs.status = "Progressing"
    30  hs.message = "Waiting for 3scale Product status..."
    31  return hs