Skip to content

Commit 8401981

Browse files
feat: argo-cd cm custom rollout action 'pause' 'skip-current-step' (#443)
* feat: argo-cd cm custom rollout action 'pause' 'skip-current-step' * removed redundant if
1 parent 7099828 commit 8401981

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

charts/gitops-runtime/values.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,30 @@ argo-cd:
206206
timeout.reconciliation: 20s
207207
accounts.admin: apiKey,login
208208
application.resourceTrackingMethod: annotation+label
209+
resource.customizations.actions.argoproj.io_Rollout: |
210+
mergeBuiltinActions: true
211+
discovery.lua: |
212+
actions = {}
213+
local fullyPromoted = obj.status.currentPodHash == obj.status.stableRS
214+
actions["pause"] = {["disabled"] = fullyPromoted or obj.spec.paused == true}
215+
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)}
216+
return actions
217+
definitions:
218+
- name: pause
219+
action.lua: |
220+
obj.spec.paused = true
221+
return obj
222+
- name: skip-current-step
223+
action.lua: |
224+
if obj.status ~= nil then
225+
if obj.spec.strategy.canary ~= nil and obj.spec.strategy.canary.steps ~= nil and obj.status.currentStepIndex < table.getn(obj.spec.strategy.canary.steps) then
226+
if obj.status.pauseConditions ~= nil and table.getn(obj.status.pauseConditions) > 0 then
227+
obj.status.pauseConditions = nil
228+
end
229+
obj.status.currentStepIndex = obj.status.currentStepIndex + 1
230+
end
231+
end
232+
return obj
209233
params:
210234
server.insecure: true
211235
application.namespaces: 'cf-*'

0 commit comments

Comments
 (0)