github.com/argoproj/argo-cd/v2@v2.10.9/resource_customizations/cluster.x-k8s.io/Cluster/health.lua (about)

     1  function getStatusBasedOnPhase(obj, hs)
     2      hs.status = "Progressing"
     3      hs.message = "Waiting for clusters"
     4      if obj.status ~= nil and obj.status.phase ~= nil then
     5          if obj.status.phase == "Provisioned" then
     6              hs.status = "Healthy"
     7              hs.message = "Cluster is running"
     8          end
     9          if obj.status.phase == "Failed" then
    10              hs.status = "Degraded"
    11              hs.message = ""
    12          end
    13      end
    14      return hs
    15  end
    16  
    17  function getReadyContitionStatus(obj, hs)
    18      if obj.status ~= nil and obj.status.conditions ~= nil then
    19          for i, condition in ipairs(obj.status.conditions) do
    20          if condition.type == "Ready" and condition.status == "False" then
    21              hs.status = "Degraded"
    22              hs.message = condition.message
    23              return hs
    24          end
    25          end
    26      end
    27      return hs
    28  end
    29  
    30  local hs = {}
    31  if obj.spec.paused ~= nil and obj.spec.paused then
    32      hs.status = "Suspended"
    33      hs.message = "Cluster is paused"
    34      return hs
    35  end
    36  
    37  getStatusBasedOnPhase(obj, hs)
    38  getReadyContitionStatus(obj, hs)
    39  
    40  return hs