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

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