github.com/argoproj/argo-cd/v3@v3.2.1/resource_customizations/game.kruise.io/GameServerSet/health.lua (about)

     1  hs = {status="Progressing", message="Waiting for GameServerSet initialization"}
     2  
     3  if obj.status and obj.metadata.generation == obj.status.observedGeneration then
     4    local ru = obj.spec.updateStrategy and obj.spec.updateStrategy.rollingUpdate or {}
     5  
     6    -- 1) Pause
     7    if ru.paused == true then
     8      hs.status  = "Suspended"
     9      hs.message = "GameServerSet is paused"
    10      return hs
    11    end
    12  
    13    -- 2) Partition
    14    local partition = ru.partition or 0
    15    if partition ~= 0 and (obj.status.updatedReplicas or 0) >= (obj.status.replicas or 0) - partition then
    16      hs.status  = "Suspended"
    17      hs.message = "Partition=" .. partition .. ", waiting for manual intervention"
    18      return hs
    19    end
    20  
    21    -- 3) All updated and ready
    22    if (obj.status.updatedReadyReplicas or 0) == (obj.status.replicas or 0) then
    23      hs.status  = "Healthy"
    24      hs.message = "All GameServerSet replicas are updated and ready"
    25      return hs
    26    end
    27  
    28    -- 4) ReadyRelicas not enough
    29    if (obj.status.readyReplicas or 0) < (obj.status.replicas or 0) then
    30      hs.status  = "Progressing"
    31      hs.message = "ReadyReplicas " ..
    32                   (obj.status.readyReplicas or 0) .. "/" ..
    33                   (obj.status.replicas or 0) .. ", still progressing"
    34      return hs
    35    end
    36  end
    37  
    38  return hs