github.com/argoproj/argo-cd@v1.8.7/resource_customizations/operator.knative.dev/KnativeEventing/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.status == "Unknown" then
    14          numFalse = numFalse + 1
    15        end
    16      end
    17      if(numFalse > 0) then
    18        health_status.message = msg
    19        health_status.status = "Progressing"
    20        return health_status
    21      elseif(numTrue == 2) then
    22        health_status.message = "KnativeEventing is healthy."
    23        health_status.status = "Healthy"
    24        return health_status
    25      else
    26        health_status.message = msg
    27        health_status.status = "Degraded"
    28        return health_status
    29      end
    30    end
    31  end
    32  health_status.status = "Progressing"
    33  health_status.message = "Waiting for KnativeEventing"
    34  return health_status