-
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.
change ResultRef.ResultsIndex from int to *int
This commit closes 7392. When we introduced array results, we added validation funciton to check if the result reference is out of the array bound, in the cases of refercing a whole array and that array is empty, the resolved array index is 0, so the validation will error. Since the resolved index is only used when array indexing references exist, it is an optional field for ResultRef so we should change it to a pointer. Signed-off-by: Yongxuan Zhang [email protected]
- Loading branch information
1 parent
a179226
commit 6ad3693
Showing
11 changed files
with
115 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
apiVersion: tekton.dev/v1 | ||
kind: Task | ||
metadata: | ||
name: task-with-array-result | ||
spec: | ||
params: | ||
- name: arrayVal1 | ||
description: "description3" | ||
type: array | ||
default: [] | ||
steps: | ||
- name: step1 | ||
image: bash:latest | ||
args: | ||
- --images | ||
- $(params.arrayVal1[*]) | ||
script: | | ||
#!/usr/bin/env bash | ||
for arg in "$@"; do | ||
echo $arg | ||
done | ||
- name: step2 | ||
image: bash:latest | ||
script: | | ||
#!/usr/bin/env bash | ||
echo -n '[]' | tee $(results.resultArray.path) | ||
results: | ||
- name: resultArray | ||
description: "description4" | ||
type: array | ||
|
||
--- | ||
apiVersion: tekton.dev/v1 | ||
kind: PipelineRun | ||
metadata: | ||
name: pipelinerun-array-result | ||
spec: | ||
pipelineSpec: | ||
tasks: | ||
- name: task-1 | ||
taskRef: | ||
name: task-with-array-result | ||
params: | ||
- name: arrayVal1 | ||
value: [] | ||
- name: task-2 | ||
taskRef: | ||
name: task-with-array-result | ||
params: | ||
- name: arrayVal1 | ||
value: $(tasks.task-1.results.resultArray) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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