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

     1  local hs = {}
     2  
     3  if obj.status ~= nil then
     4    if obj.status.state ~= nil and obj.status.state == "suspended" then
     5      hs.status = "Suspended"
     6      hs.message = "3scale Application is suspended"
     7      return hs
     8    end
     9  
    10    local application_id = obj.status.adminId
    11    local has_application_id = (application_id ~= nil and type(application_id) == "number" and application_id > 0)
    12  
    13    if obj.status.conditions ~= nil then
    14      for _, condition in ipairs(obj.status.conditions) do
    15        if condition.type == "Ready" then
    16          if condition.status == "True" then
    17            hs.status = "Healthy"
    18            hs.message = "3scale Application is ready"
    19            return hs
    20          elseif not has_application_id then
    21            hs.status = "Degraded"
    22            hs.message = condition.message or "3scale Application is not ready"
    23            return hs
    24          end
    25        end
    26      end
    27    end
    28  end
    29  
    30  hs.status = "Progressing"
    31  hs.message = "Waiting for 3scale Application status..."
    32  return hs