diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 73d92c03..2501de00 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -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-*'