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

     1  health_status = {}
     2  if obj.status ~= nil then
     3    if obj.status.conditions ~= nil then
     4      numTrue = 0
     5      numFalse = 0
     6      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 == "DeploymentsAvailable" and condition.status == "False" then
    18          numFalse = numFalse + 1
    19        elseif condition.status == "Unknown" then
    20          numFalse = numFalse + 1
    21        end
    22      end
    23      if(numFalse > 0) then
    24        health_status.message = msg
    25        health_status.status = "Progressing"
    26        return health_status
    27      elseif(numTrue == 4) then
    28        health_status.message = "KnativeServing is healthy."
    29        health_status.status = "Healthy"
    30        return health_status
    31      else
    32        health_status.message = msg
    33        health_status.status = "Degraded"
    34        return health_status
    35      end
    36    end
    37  end
    38  health_status.status = "Progressing"
    39  health_status.message = "Waiting for KnativeServing"
    40  return health_status