Skip to content

Commit d8b27e5

Browse files
author
Tihomir Surdilovic
authored
Change functionref definition 'parameters' to 'arguments' (#263)
* Change functionref definition 'parameters' to 'arguments' Signed-off-by: Tihomir Surdilovic <[email protected]> * fix argo comparison example Signed-off-by: Tihomir Surdilovic <[email protected]>
1 parent 1cb7582 commit d8b27e5

File tree

10 files changed

+154
-151
lines changed

10 files changed

+154
-151
lines changed

comparisons/comparison-argo.md

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ states:
8989
actions:
9090
- functionRef:
9191
refName: whalesayimage
92-
parameters:
92+
arguments:
9393
message: "{{ $.message }}"
9494
end: true
9595
```
@@ -117,12 +117,8 @@ metadata:
117117
generateName: steps-
118118
spec:
119119
entrypoint: hello-hello-hello
120-
121-
# This spec contains two templates: hello-hello-hello and whalesay
122120
templates:
123121
- name: hello-hello-hello
124-
# Instead of just running a container
125-
# This template has a sequence of steps
126122
steps:
127123
- - name: hello1 # hello1 is run before the following steps
128124
template: whalesay
@@ -142,8 +138,6 @@ spec:
142138
parameters:
143139
- name: message
144140
value: "hello2b"
145-
146-
# This is the same template as from the previous example
147141
- name: whalesay
148142
inputs:
149143
parameters:
@@ -173,7 +167,7 @@ states:
173167
actions:
174168
- functionRef:
175169
refName: whalesayimage
176-
parameters:
170+
arguments:
177171
message: hello1
178172
transition: parallelhello
179173
- name: parallelhello
@@ -184,13 +178,13 @@ states:
184178
actions:
185179
- functionRef:
186180
refName: whalesayimage
187-
parameters:
181+
arguments:
188182
message: hello2a
189183
- name: hello2b-branch
190184
actions:
191185
- functionRef:
192186
refName: whalesayimage
193-
parameters:
187+
arguments:
194188
message: hello2b
195189
end: true
196190
```
@@ -274,7 +268,7 @@ states:
274268
actions:
275269
- functionRef:
276270
refName: echo
277-
parameters:
271+
arguments:
278272
message: A
279273
transition: parallelecho
280274
- name: parallelecho
@@ -285,13 +279,13 @@ states:
285279
actions:
286280
- functionRef:
287281
refName: echo
288-
parameters:
282+
arguments:
289283
message: B
290284
- name: C-branch
291285
actions:
292286
- functionRef:
293287
refName: echo
294-
parameters:
288+
arguments:
295289
message: C
296290
transition: D
297291
- name: D
@@ -300,7 +294,7 @@ states:
300294
actions:
301295
- functionRef:
302296
refName: echo
303-
parameters:
297+
arguments:
304298
message: D
305299
end: true
306300
```
@@ -418,7 +412,7 @@ states:
418412
actions:
419413
- functionRef:
420414
refName: printmessagefunc
421-
parameters:
415+
arguments:
422416
message: "{{ $.results }}"
423417
end: true
424418
```
@@ -498,7 +492,7 @@ states:
498492
- name: print-message
499493
functionRef:
500494
refName: whalesay
501-
parameters:
495+
arguments:
502496
message: "{{ $.greeting }}"
503497
end: true
504498
```
@@ -643,9 +637,11 @@ spec:
643637
limit: 10
644638
retryPolicy: "Always"
645639
backoff:
646-
duration: "1"
640+
duration: "1" # Must be a string. Default unit is seconds. Could also be a Duration, e.g.: "2m", "6h", "1d"
647641
factor: 2
648-
maxDuration: "1m"
642+
maxDuration: "1m" # Must be a string. Default unit is seconds. Could also be a Duration, e.g.: "2m", "6h", "1d"
643+
affinity:
644+
nodeAntiAffinity: {}
649645
container:
650646
image: python:alpine3.6
651647
command: ["python", -c]
@@ -678,7 +674,7 @@ states:
678674
actions:
679675
- functionRef:
680676
refName: flip-coin-function
681-
parameters:
677+
arguments:
682678
args:
683679
- import random; import sys; exit_code = random.choice([0, 1, 1]); sys.exit(exit_code)
684680
onErrors:
@@ -780,7 +776,7 @@ states:
780776
actions:
781777
- functionRef:
782778
refName: heads-function
783-
parameters:
779+
arguments:
784780
args: echo "it was heads"
785781
end: true
786782
```
@@ -816,19 +812,14 @@ metadata:
816812
generateName: exit-handlers-
817813
spec:
818814
entrypoint: intentional-fail
819-
onExit: exit-handler
815+
onExit: exit-handler # invoke exit-handler template at end of the workflow
820816
templates:
821817
# primary workflow template
822818
- name: intentional-fail
823819
container:
824820
image: alpine:latest
825821
command: [sh, -c]
826822
args: ["echo intentional failure; exit 1"]
827-
828-
# Exit handler templates
829-
# After the completion of the entrypoint template, the status of the
830-
# workflow is made available in the global variable {{workflow.status}}.
831-
# {{workflow.status}} will be one of: Succeeded, Failed, Error
832823
- name: exit-handler
833824
steps:
834825
- - name: notify
@@ -883,7 +874,7 @@ states:
883874
actions:
884875
- functionRef:
885876
refName: intentional-fail-function
886-
parameters:
877+
arguments:
887878
args: echo intentional failure; exit 1
888879
onErrors:
889880
- error: "*"
@@ -893,7 +884,7 @@ states:
893884
actions:
894885
- functionRef:
895886
refName: send-email-function
896-
parameters:
887+
arguments:
897888
args: 'echo send e-mail: $.workflow.name $.exit-code'
898889
transition: emo-state
899890
- name: emo-state
@@ -908,15 +899,15 @@ states:
908899
actions:
909900
- functionRef:
910901
refName: celebrate-cry-function
911-
parameters:
902+
arguments:
912903
args: echo hooray!
913904
end: true
914905
- name: cry-state
915906
type: operation
916907
actions:
917908
- functionRef:
918909
refName: celebrate-cry-function
919-
parameters:
910+
arguments:
920911
args: echo boohoo!
921912
end: true
922913
```

comparisons/comparison-brigade.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,17 @@ states:
8686
- name: sayHelloAction
8787
functionRef:
8888
refName: greetingFunction
89-
parameters:
89+
arguments:
9090
greeting: hello
9191
- name: sayGoodbyeAction
9292
functionRef:
9393
refName: greetingFunction
94-
parameters:
94+
arguments:
9595
greeting: hello
9696
- name: logDoneAction
9797
functionRef:
9898
refName: consoleLogFunction
99-
parameters:
99+
arguments:
100100
log: done
101101
end: true
102102
```
@@ -165,17 +165,17 @@ states:
165165
- name: sayHelloAction
166166
functionRef:
167167
refName: greetingFunction
168-
parameters:
168+
arguments:
169169
greeting: hello
170170
- name: sayGoodbyeAction
171171
functionRef:
172172
refName: greetingFunction
173-
parameters:
173+
arguments:
174174
greeting: hello
175175
- name: logDoneAction
176176
functionRef:
177177
refName: consoleLogFunction
178-
parameters:
178+
arguments:
179179
log: done
180180
onErrors:
181181
- error: "*"
@@ -187,8 +187,8 @@ states:
187187
- name: logErrorAction
188188
functionRef:
189189
refName: consoleLogFunction
190-
parameters:
191-
log: Caught Exception $.exception
190+
arguments:
191+
log: Caught Exception ${ .exception }
192192
end: true
193193
```
194194
@@ -246,15 +246,15 @@ states:
246246
- name: logExecEventAction
247247
functionRef:
248248
refName: consoleLogFunction
249-
parameters:
249+
arguments:
250250
log: "==> handling an 'exec' event"
251251
- eventRefs:
252252
- pushEvent
253253
actions:
254254
- name: logPushEventAction
255255
functionRef:
256256
refName: consoleLogFunction
257-
parameters:
257+
arguments:
258258
log: "**** I'm a GitHub 'push' handler"
259259
end: true
260260
```
@@ -330,12 +330,12 @@ states:
330330
- name: firstHelloAction
331331
functionRef:
332332
refName: echoFunction
333-
parameters:
333+
arguments:
334334
message: hello
335335
- name: firstGoodbyeAction
336336
functionRef:
337337
refName: echoFunction
338-
parameters:
338+
arguments:
339339
message: goodbye
340340
transition: SecondGreetGroup
341341
- name: SecondGreetGroup
@@ -344,12 +344,12 @@ states:
344344
- name: secondHelloAction
345345
functionRef:
346346
refName: echoFunction
347-
parameters:
347+
arguments:
348348
message: hello-again
349349
- name: secondGoodbyeAction
350350
functionRef:
351351
refName: echoFunction
352-
parameters:
352+
arguments:
353353
message: bye-again
354354
end: true
355355
```
@@ -408,12 +408,12 @@ states:
408408
- name: eventInfoAction
409409
functionRef:
410410
refName: consoleFunction
411-
parameters:
411+
arguments:
412412
log: ">>> event $event.type caused by $.event.data.provider"
413413
- name: projectInfoAction
414414
functionRef:
415415
refName: consoleFunction
416-
parameters:
416+
arguments:
417417
log: ">>> project $event.data.project.name clones the repo at by $.event.data.repo.cloneURL"
418418
end: true
419419

@@ -491,19 +491,19 @@ states:
491491
dataResultsPath: "{{ $.helloResult }}"
492492
functionRef:
493493
refName: greetingFunction
494-
parameters:
494+
arguments:
495495
message: hello
496496
- name: worldAction
497497
actionDataFilter:
498498
dataResultsPath: "{{ $.worldResults }}"
499499
functionRef:
500500
refName: greetingAction
501-
parameters:
501+
arguments:
502502
message: world
503503
- name: storeToFileAction
504504
functionRef:
505505
refName: storeToFileFunction
506-
parameters:
506+
arguments:
507507
destination: "{{ $.event.destination }}"
508508
value: "{{ $.helloResult }} {{ $.worldResults }}"
509509
end: true
@@ -595,7 +595,7 @@ states:
595595
- name: consoleLogAction
596596
functionRef:
597597
refName: consoleLogFunction
598-
parameters:
598+
arguments:
599599
log: fired $.nextEvent.data.type caused by $.nextEvent.data.cause.event
600600
end: true
601601
```

comparisons/comparison-cadence.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,13 @@ states:
198198
actions:
199199
- functionRef:
200200
refName: processfilefunction
201-
parameters:
201+
arguments:
202202
filename: "{{ $file.name }}"
203203
actionDataFilter:
204204
dataResultsPath: "{{ $.processed }}"
205205
- functionRef:
206206
refName: uploadfunction
207-
parameters:
207+
arguments:
208208
file: "{{ $processed }}"
209209
onErrors:
210210
- error: "*"

comparisons/comparison-google-cloud-workflows.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ it just complicates things and is not needed.
293293
{
294294
"functionRef": {
295295
"refName": "StopComputeEngine",
296-
"parameters": {
296+
"arguments": {
297297
"project": "{{ $.project }}",
298298
"zone": "{{ $.zone }}",
299299
"vmToStop": "{{ $.vmToStop }}"
@@ -423,7 +423,7 @@ as service invocations, where as Google Workflow uses the "call" keyword.
423423
{
424424
"functionRef": {
425425
"refName": "PublishToTopic",
426-
"parameters": {
426+
"arguments": {
427427
"project": "{{ $.project }}",
428428
"topic": "{{ $.topic }}",
429429
"message": "{{ $.message }}"

0 commit comments

Comments
 (0)