github.com/argoproj/argo-cd@v1.8.7/resource_customizations/flagger.app/Canary/health.lua (about)

     1  sep = " --- "
     2  hs = {}
     3  if obj.status ~= nil then
     4    message = ""
     5    if tonumber(obj.status.canaryWeight) > 0 then            
     6      message = "Canary Weight: " .. obj.status.canaryWeight .. " %"
     7    end
     8    for i, condition in ipairs(obj.status.conditions) do
     9      if message ~= "" then
    10        message = message .. sep
    11      end
    12      message = message .. condition.message
    13    end          
    14    if obj.status.phase == "Failed" then
    15      hs.status = "Degraded"
    16    elseif ( obj.status.phase == "Progressing" or 
    17        obj.status.phase == "Finalising" or
    18        obj.status.phase == "Promoting" ) then             
    19      hs.status = "Progressing"
    20    elseif ( obj.status.phase == "Succeeded" or 
    21        obj.status.phase == "Initialized" ) then
    22      hs.status = "Healthy"
    23    else
    24      hs.status = "Unknown"
    25    end
    26    hs.message = obj.status.phase .. sep .. message 
    27    return hs
    28  end        
    29  hs.status = "Unknown"
    30  hs.message = "No status"
    31  return hs