github.com/argoproj/argo-cd/v3@v3.2.1/resource_customizations/grafana.integreatly.org/GrafanaFolder/health.lua (about)

     1  -- Reference CRD can be found here:
     2  -- https://grafana.github.io/grafana-operator/docs/api/#grafanafolder
     3  
     4  function getStatusFromConditions(obj, hs)
     5    if obj.status ~= nil and obj.status.conditions ~= nil then
     6        for i, condition in ipairs(obj.status.conditions) do
     7            if condition.status ~= nil then
     8              if hs.message ~= "" then
     9                hs.message = hs.message .. ", "
    10              end
    11  
    12              if condition.reason ~= nil then
    13                hs.message = hs.message .. condition.reason
    14                if condition.type ~= nil then
    15                    hs.message = hs.message .. " for " .. condition.type
    16                  if condition.message ~= nil then
    17                      hs.message = hs.message .. " because " .. condition.message
    18                  end
    19                end
    20              end
    21  
    22              if condition.status == "False" then
    23                hs.status = "Degraded"
    24                return hs
    25              end
    26  
    27              if condition.status == "True" then
    28                hs.status = "Healthy"
    29              end
    30            end
    31        end
    32    end
    33  
    34    return hs
    35  end
    36  
    37  local hs = {}
    38  hs.status = "Progressing"
    39  hs.message = ""
    40  
    41  hs = getStatusFromConditions(obj, hs)
    42  
    43  return hs