File tree Expand file tree Collapse file tree 1 file changed +70
-0
lines changed
workflows/argo-events/workflowtemplates Expand file tree Collapse file tree 1 file changed +70
-0
lines changed Original file line number Diff line number Diff line change 1+ apiVersion : argoproj.io/v1alpha1
2+ kind : WorkflowTemplate
3+ metadata :
4+ name : patch-application-automated-sync
5+ spec :
6+ entrypoint : main
7+ arguments :
8+ parameters :
9+ - name : name
10+ description : " Name of the Application resource to modify."
11+ - name : duration
12+ description : " Duration in minutes to keep automated sync disabled."
13+ value : " 30"
14+
15+ templates :
16+ - name : main
17+ dag :
18+ tasks :
19+ - name : disable-automated-sync
20+ template : patch-automated-sync
21+ arguments :
22+ parameters :
23+ - name : resource-name
24+ value : " {{workflow.parameters.name}}"
25+ - name : automated-value
26+ value : " false"
27+
28+ - name : wait-for-duration
29+ template : wait
30+ dependencies : [disable-automated-sync]
31+ arguments :
32+ parameters :
33+ - name : duration-minutes
34+ value : " {{workflow.parameters.duration}}"
35+
36+ - name : enable-automated-sync
37+ template : patch-automated-sync
38+ dependencies : [wait-for-duration]
39+ arguments :
40+ parameters :
41+ - name : resource-name
42+ value : " {{workflow.parameters.name}}"
43+ - name : automated-value
44+ value : " true"
45+
46+ - name : patch-automated-sync
47+ inputs :
48+ parameters :
49+ - name : resource-name
50+ - name : automated-value
51+ resource :
52+ action : patch
53+ group : argoproj.io
54+ version : v1alpha1
55+ kind : Application
56+ name : " {{inputs.parameters.resource-name}}"
57+ patch : |
58+ [
59+ {
60+ "op": "replace",
61+ "path": "/spec/syncPolicy/automated",
62+ "value": {{inputs.parameters.automated-value}}
63+ }
64+ ]
65+ - name : wait
66+ inputs :
67+ parameters :
68+ - name : duration-minutes
69+ suspend :
70+ duration : " {{=sprig.int(inputs.parameters.duration-minutes) * 60}}" # Convert minutes to seconds string for duration
You can’t perform that action at this time.
0 commit comments