github.com/argoproj/argo-cd/v3@v3.2.1/resource_customizations/game.kruise.io/GameServer/health.lua (about) 1 hs = {status="Unknown", message="Waiting for GameServer to be ready"} 2 3 if obj.status then 4 local cur = obj.status.currentState 5 local dest = obj.status.desiredState 6 7 -- 1) Check cur and dest status: Progressing 8 if cur ~= dest then 9 hs.status = "Progressing" 10 hs.message = "State change: " .. (cur or "Unknown") .. " → " .. (dest or "Unknown") 11 return hs 12 end 13 14 -- 2) Check pod: KruisePodReady 15 local podCond = obj.status.podStatus or {} 16 for _, c in ipairs(podCond.conditions or {}) do 17 if c.type == "KruisePodReady" and c.status ~= "True" then 18 hs.status = "Degraded" 19 hs.message = "Pod is not ready: " .. c.type 20 return hs 21 end 22 end 23 24 -- 3) Both ready: Healthy 25 if cur == "Ready" and dest == "Ready" then 26 hs.status = "Healthy" 27 hs.message = "GameServer is Ready" 28 return hs 29 end 30 end 31 32 return hs