Skip to content

feat: argo-cd cm custom rollout action 'pause' 'skip-current-step' #443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions charts/gitops-runtime/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,30 @@ argo-cd:
timeout.reconciliation: 20s
accounts.admin: apiKey,login
application.resourceTrackingMethod: annotation+label
resource.customizations.actions.argoproj.io_Rollout: |
mergeBuiltinActions: true
discovery.lua: |
actions = {}
local fullyPromoted = obj.status.currentPodHash == obj.status.stableRS
actions["pause"] = {["disabled"] = fullyPromoted or obj.spec.paused == true}
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)}
return actions
definitions:
- name: pause
action.lua: |
obj.spec.paused = true
return obj
- name: skip-current-step
action.lua: |
if obj.status ~= nil then
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
if obj.status.pauseConditions ~= nil and table.getn(obj.status.pauseConditions) > 0 then
obj.status.pauseConditions = nil
end
obj.status.currentStepIndex = obj.status.currentStepIndex + 1
end
end
return obj
params:
server.insecure: true
application.namespaces: 'cf-*'
Expand Down