github.com/argoproj/argo-cd/v2@v2.10.9/resource_customizations/operator.knative.dev/KnativeServing/health.lua (about)

     1  local health_status = {}
     2  if obj.status ~= nil then
     3    if obj.status.conditions ~= nil then
     4      local numTrue = 0
     5      local numFalse = 0
     6      local msg = ""
     7      for i, condition in pairs(obj.status.conditions) do
     8        msg = msg .. i .. ": " .. condition.type .. " | " .. condition.status .. "\n"
     9        if condition.type == "Ready" and condition.status == "True" then
    10          numTrue = numTrue + 1
    11        elseif condition.type == "InstallSucceeded" and condition.status == "True" then
    12          numTrue = numTrue + 1
    13        elseif condition.type == "DependenciesInstalled" and condition.status == "True" then
    14          numTrue = numTrue + 1
    15        elseif condition.type == "DeploymentsAvailable" and condition.status == "True" then
    16          numTrue = numTrue + 1
    17        elseif condition.type == "Ready" and condition.status == "False" then
    18          numFalse = numFalse + 1
    19        elseif condition.type == "DeploymentsAvailable" and condition.status == "False" then
    20          numFalse = numFalse + 1
    21        elseif condition.status == "Unknown" then
    22          numFalse = numFalse + 1
    23        end
    24      end
    25      if(numFalse > 0) then
    26        health_status.message = msg
    27        health_status.status = "Progressing"
    28        return health_status
    29      elseif(numTrue == 4) then
    30        health_status.message = "KnativeServing is healthy."
    31        health_status.status = "Healthy"
    32        return health_status
    33      else
    34        health_status.message = msg
    35        health_status.status = "Degraded"
    36        return health_status
    37      end
    38    end
    39  end
    40  health_status.status = "Progressing"
    41  health_status.message = "Waiting for KnativeServing"
    42  return health_status