github.com/argoproj/argo-cd@v1.8.7/resource_customizations/argoproj.io/Rollout/actions/discovery.lua (about)

     1  actions = {}
     2  actions["restart"] = {["disabled"] = false}
     3  
     4  local paused = false
     5  if obj.status ~= nil and obj.status.pauseConditions ~= nil then
     6      paused = table.getn(obj.status.pauseConditions) > 0
     7  elseif obj.spec.paused ~= nil then
     8      paused = obj.spec.paused
     9  end
    10  actions["resume"] = {["disabled"] = not(paused)}
    11  
    12  fullyPromoted = obj.status.currentPodHash == obj.status.stableRS
    13  actions["abort"] = {["disabled"] = fullyPromoted or obj.status.abort}
    14  actions["retry"] = {["disabled"] = fullyPromoted or not(obj.status.abort)}
    15  
    16  actions["promote-full"] = {["disabled"] = true}
    17  if obj.status ~= nil and not(fullyPromoted) then
    18      generation = tonumber(obj.status.observedGeneration)
    19      if generation == nil or generation > obj.metadata.generation then
    20          -- rollouts v0.9 - full promotion only supported for canary
    21          actions["promote-full"] = {["disabled"] = obj.spec.strategy.blueGreen ~= nil}
    22      else
    23          -- rollouts v0.10+
    24          actions["promote-full"]["disabled"] = false
    25      end
    26  end
    27  
    28  return actions