-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add example and docs for array param with defaults 📜
While working on (finally) updating the array result and object param/result TEPs (tektoncd/community#479 tektoncd/community#477) I realized I hadn't included an example of how to specify defaults for the new format, so I looked for an example of how we currently do this for arrays, but we had none! Hopefully now we do :D
- Loading branch information
1 parent
1cb7565
commit 4c45dbd
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: TaskRun | ||
metadata: | ||
generateName: array-with-default- | ||
spec: | ||
params: | ||
- name: array-to-echo | ||
value: | ||
- "foo" | ||
- "bar" | ||
taskSpec: | ||
params: | ||
- name: array-to-echo | ||
type: array | ||
- name: another-array-to-echo | ||
type: array | ||
default: | ||
- "foo-default" | ||
- "bar-default" | ||
- name: string-to-echo | ||
type: string | ||
default: "baz" | ||
steps: | ||
# this step should echo "foo bar foo-default bar-default baz" | ||
- name: echo-params | ||
image: bash:3.2 | ||
args: [ | ||
"echo", | ||
"$(params.array-to-echo[*])", | ||
"$(params.another-array-to-echo[*])", | ||
"$(params.string-to-echo)", | ||
] |