github.com/argoproj/argo-cd/v2@v2.10.9/resource_customizations/db.atlasgo.io/AtlasMigration/health.lua (about)

     1  hs = {}
     2  
     3  local function readyCond(obj)
     4    if obj.status ~= nil and obj.status.conditions ~= nil then
     5      for _, condition in ipairs(obj.status.conditions) do
     6        if condition.type == "Ready" then
     7          return condition
     8        end
     9      end
    10    end
    11    return nil
    12  end
    13  
    14  local ready = readyCond(obj)
    15  
    16  if ready == nil then
    17    hs.status = "Progressing"
    18    hs.message = "Waiting for Atlas Operator"
    19    return hs
    20  end
    21  
    22  if ready.status == "True" then
    23    hs.status = "Healthy"
    24    hs.message = ready.reason
    25    return hs
    26  end
    27  
    28  if ready.reason == "Reconciling" then
    29    hs.status = "Progressing"
    30  else
    31    hs.status = "Degraded"
    32  end
    33  
    34  hs.message = ready.reason
    35  
    36  return hs
    37