github.com/argoproj/argo-cd/v2@v2.10.9/resource_customizations/route.openshift.io/Route/health.lua (about)

     1  local health_status = {}
     2  if obj.status ~= nil then
     3    if obj.status.ingress ~= nil then
     4      local numIngressRules = 0
     5      local numTrue = 0
     6      local numFalse = 0
     7      for _, ingressRules in pairs(obj.status.ingress) do
     8          numIngressRules = numIngressRules + 1
     9          if obj.status.ingress ~= nil then
    10            for _, condition in pairs(ingressRules.conditions) do
    11                if condition.type == "Admitted" and condition.status == "True" then
    12                    numTrue = numTrue + 1
    13                elseif condition.type == "Admitted" and condition.status == "False" then
    14                    numFalse = numFalse + 1
    15                end
    16            end
    17          end
    18          health_status.status = 'Test'
    19      end
    20      if numTrue == numIngressRules then
    21        health_status.status = "Healthy"
    22        health_status.message = "Route is healthy"
    23        return health_status
    24      elseif numFalse > 0 then
    25        health_status.status = "Degraded"
    26        health_status.message = "Route is degraded"
    27        return health_status
    28      else
    29        health_status.status = "Progressing"
    30        health_status.message = "Route is still getting admitted"
    31        return health_status
    32      end
    33    end
    34  end
    35  health_status.status = "Progressing"
    36  health_status.message = "Route is still getting admitted"
    37  return health_status