github.com/argoproj/argo-cd/v2@v2.10.9/resource_customizations/apps.kruise.io/DaemonSet/health.lua (about)

     1  hs={ status = "Progressing", message = "Waiting for initialization" }
     2  
     3  if obj.status ~= nil then
     4  
     5      if obj.metadata.generation == obj.status.observedGeneration then
     6  
     7          if obj.spec.updateStrategy.rollingUpdate.paused == true or not obj.status.updatedNumberScheduled then
     8              hs.status = "Suspended"
     9              hs.message = "Daemonset is paused"
    10              return hs
    11          elseif obj.spec.updateStrategy.rollingUpdate.partition ~= 0 and obj.metadata.generation > 1 then
    12              if obj.status.updatedNumberScheduled > (obj.status.desiredNumberScheduled - obj.spec.updateStrategy.rollingUpdate.partition) then
    13                  hs.status = "Suspended"
    14                  hs.message = "Daemonset needs manual intervention"
    15                  return hs
    16              end
    17  
    18          elseif (obj.status.updatedNumberScheduled == obj.status.desiredNumberScheduled) and (obj.status.numberAvailable == obj.status.desiredNumberScheduled) then
    19              hs.status = "Healthy"
    20              hs.message = "All Daemonset workloads are ready and updated"    
    21              return hs
    22          
    23          else
    24              if (obj.status.updatedNumberScheduled == obj.status.desiredNumberScheduled) and (obj.status.numberUnavailable == obj.status.desiredNumberScheduled) then
    25                  hs.status = "Degraded"
    26                  hs.message = "Some pods are not ready or available"
    27                  return hs
    28              end
    29          end
    30  
    31      end
    32  
    33  end
    34  
    35  return hs