github.com/argoproj/argo-cd/v3@v3.2.1/resource_customizations/numaplane.numaproj.io/MonoVertexRollout/actions/discovery.lua (about) 1 local actions = {} 2 actions["pause"] = { 3 ["disabled"] = true, 4 ["iconClass"] = "fa-solid fa-fw fa-pause" 5 } 6 actions["unpause-gradual"] = { 7 ["disabled"] = true, 8 ["displayName"] = "Unpause (gradual)", 9 ["iconClass"] = "fa-solid fa-fw fa-play" 10 } 11 actions["unpause-fast"] = { 12 ["disabled"] = true, 13 ["displayName"] = "Unpause (fast)", 14 ["iconClass"] = "fa-solid fa-fw fa-play" 15 } 16 17 -- pause/unpause 18 local paused = false 19 if obj.spec.monoVertex.spec.lifecycle ~= nil and obj.spec.monoVertex.spec.lifecycle.desiredPhase ~= nil and obj.spec.monoVertex.spec.lifecycle.desiredPhase == "Paused" then 20 paused = true 21 end 22 if paused then 23 if obj.spec.monoVertex.metadata ~= nil and obj.spec.monoVertex.metadata.annotations ~= nil and obj.spec.monoVertex.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] ~= nil then 24 -- determine which unpausing strategies will be enabled 25 -- if annotation not found, default will be resume slow 26 if obj.spec.monoVertex.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] == "fast" then 27 actions["unpause-fast"]["disabled"] = false 28 elseif obj.spec.monoVertex.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] == "slow, fast" then 29 actions["unpause-gradual"]["disabled"] = false 30 actions["unpause-fast"]["disabled"] = false 31 else 32 actions["unpause-gradual"]["disabled"] = false 33 end 34 else 35 actions["unpause-gradual"]["disabled"] = false 36 end 37 else 38 actions["pause"]["disabled"] = false 39 end 40 41 return actions