From b609a8ae8522be4d9fc5620c3077a6ec1b87b12b Mon Sep 17 00:00:00 2001 From: dthomson25 Date: Fri, 27 Sep 2019 15:13:11 -0700 Subject: [PATCH] Add custom action example to argocd-cm.yaml (#2375) --- docs/operator-manual/argocd-cm.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/operator-manual/argocd-cm.yaml b/docs/operator-manual/argocd-cm.yaml index 560f062176..aacc95cc5f 100644 --- a/docs/operator-manual/argocd-cm.yaml +++ b/docs/operator-manual/argocd-cm.yaml @@ -124,6 +124,27 @@ data: hs.status = "Progressing" hs.message = "Waiting for certificate" return hs + apps/Deployment: + # List of Lua Scripts to introduce custom actions + actions: | + # Lua Script to indicate which custom actions are available on the resource + discovery.lua: | + actions = {} + actions["restart"] = {} + return actions + definitions: + - name: restart + # Lua Script to modify the obj + action.lua: | + local os = require("os") + if obj.spec.template.metadata == nil then + obj.spec.template.metadata = {} + end + if obj.spec.template.metadata.annotations == nil then + obj.spec.template.metadata.annotations = {} + end + obj.spec.template.metadata.annotations["kubectl.kubernetes.io/restartedAt"] = os.date("!%Y-%m-%dT%XZ") + return obj # Configuration to completely ignore entire classes of resource group/kinds (optional). # Excluding high-volume resources improves performance and memory usage, and reduces load and