github.com/argoproj/argo-cd/v3@v3.2.1/resource_customizations/openfaas.com/Function/health.lua (about)

     1  hs = {}
     2  if obj.status ~= nil then
     3      if obj.status.conditions ~= nil then
     4      for i, condition in ipairs(obj.status.conditions) do
     5          if condition.type == "Ready" and condition.status == "False" then
     6          hs.status = "Degraded"
     7          hs.message = condition.message
     8          return hs
     9          end
    10          if condition.type == "Stalled" and condition.status == "True" then
    11          hs.status = "Degraded"
    12          hs.message = condition.message
    13          return hs
    14          end
    15          if condition.type == "Ready" and condition.status == "True" then
    16          if obj.status.replicas ~= nil and obj.status.replicas > 0 then
    17              hs.status = "Healthy"
    18              hs.message = condition.message
    19          else
    20              hs.status = "Suspended"
    21              hs.message = "No replicas available"
    22          end
    23          return hs
    24          end
    25      end
    26      end
    27  end
    28  
    29  hs.status = "Progressing"
    30  hs.message = "Waiting for Function"
    31  return hs