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

     1  local hs = {}
     2  if obj.status ~= nil and obj.status.conditions ~= nil then
     3    for i, condition in ipairs(obj.status.conditions) do
     4      if condition.type == "Ready" then
     5        if condition.status == "True" and condition.reason == "SuccessfulCreateOrUpdate" then
     6          hs.status = "Healthy"
     7          hs.message = "RabbitMQ exchange ready"
     8          return hs
     9        end 
    10  
    11        if condition.status == "False" and condition.reason == "FailedCreateOrUpdate" then
    12          hs.status = "Degraded"
    13          hs.message = "RabbitMQ exchange failed to be created or updated"
    14          return hs
    15        end
    16      end
    17    end
    18  end
    19  
    20  hs.status = "Unknown"
    21  hs.message = "RabbitMQ exchange status is unknown"
    22  return hs