-
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.
[TEP-0076] Add array support for emitting results
This commit provides support for emitting array results via changing TaskRunResult value from string to ArrayorString and add ResultValue for PipelineResourceResult. Previous to this commit we can only emit string type result.
- Loading branch information
1 parent
4a93b62
commit d389ed2
Showing
22 changed files
with
574 additions
and
79 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
kind: Task | ||
apiVersion: tekton.dev/v1beta1 | ||
metadata: | ||
name: write-array | ||
annotations: | ||
description: | | ||
A simple task that writes array | ||
spec: | ||
results: | ||
- name: array-results | ||
type: array | ||
description: The array results | ||
steps: | ||
- name: write-array | ||
image: bash:latest | ||
script: | | ||
#!/usr/bin/env bash | ||
echo -n "[\"hello\",\"world\"]" | tee $(results.array-results.path) | ||
- name: check-results-array | ||
image: ubuntu | ||
script: | | ||
#!/bin/bash | ||
VALUE=$(cat $(results.array-results.path)) | ||
EXPECTED=[\"hello\",\"world\"] | ||
diff=$(diff <(printf "%s\n" "${VALUE[@]}") <(printf "%s\n" "${EXPECTED[@]}")) | ||
if [[ -z "$diff" ]]; then | ||
echo "TRUE" | ||
else | ||
echo "FALSE" | ||
fi | ||
--- | ||
kind: TaskRun | ||
apiVersion: tekton.dev/v1beta1 | ||
metadata: | ||
name: write-array-tr | ||
spec: | ||
taskRef: | ||
name: write-array | ||
kind: task |
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
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.
Oops, something went wrong.