github.com/argoproj/argo-cd/v3@v3.2.1/resource_customizations/batch/Job/actions/discovery.lua (about) 1 local actions = {} 2 3 local completed = false 4 if obj.status ~= nil then 5 if obj.status.conditions ~= nil then 6 for i, condition in pairs(obj.status.conditions) do 7 if condition.type == "Complete" and condition.status == "True" then 8 completed = true 9 elseif condition.type == "Failed" and condition.status == "True" then 10 completed = true 11 elseif condition.type == "FailureTarget" and condition.status == "True" then 12 completed = true 13 elseif condition.type == "SuccessCriteriaMet" and condition.status == "True" then 14 completed = true 15 end 16 end 17 end 18 end 19 20 if not(completed) and obj.spec.suspend then 21 actions["resume"] = {["iconClass"] = "fa fa-fw fa-play" } 22 elseif not(completed) and (obj.spec.suspend == nil or not(obj.spec.suspend)) then 23 actions["suspend"] = {["iconClass"] = "fa fa-fw fa-pause" } 24 end 25 26 if not(completed) and obj.status ~= nil then 27 actions["terminate"] = {["iconClass"] = "fa fa-fw fa-stop" } 28 end 29 30 return actions