Skip to content

Commit

Permalink
docs: optimize examples for propagating results
Browse files Browse the repository at this point in the history
The propagate results only works for the embedded tasks, not for the referenced tasks.
  • Loading branch information
l-qing committed Jan 10, 2024
1 parent 933f2a0 commit e98fecb
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 34 deletions.
11 changes: 4 additions & 7 deletions docs/pipelineruns.md
Original file line number Diff line number Diff line change
Expand Up @@ -791,9 +791,8 @@ spec:
image: busybox
command: ["/bin/sh", "-c"]
args:
- echo
# - $(params.uid)
- $(tasks.add-uid.results.uid)
- echo $(tasks.add-uid.results.uid)
# - echo $(params.uid)
```

On executing the `PipelineRun`, the `Results` will be interpolated during resolution.
Expand All @@ -808,8 +807,7 @@ spec:
taskSpec:
steps:
args:
echo
1001
echo 1001
command:
- /bin/sh
- -c
Expand All @@ -830,8 +828,7 @@ status:
taskSpec:
steps:
args:
echo
1001
echo 1001
command:
/bin/sh
-c
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: uid-task
spec:
results:
- name: uid
type: string
steps:
- name: uid
image: busybox
command: ["/bin/sh", "-c"]
args:
- echo "1001" | tee $(results.uid.path)
---
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: uid-pipeline-run
spec:
pipelineSpec:
tasks:
- name: add-uid
taskRef:
name: uid-task
- name: show-uid
taskSpec:
steps:
- name: show-uid
image: busybox
command: ["/bin/sh", "-c"]
args:
- echo
- $(tasks.add-uid.results.uid)
- name: add-uid
taskSpec:
results:
- name: uid
type: string
steps:
- name: add-uid
image: busybox
command: ["/bin/sh", "-c"]
args:
- echo "1001" | tee $(results.uid.path)
- name: show-uid
# params:
# - name: uid
# value: $(tasks.add-uid.results.uid)
taskSpec:
steps:
- name: show-uid
image: busybox
command: ["/bin/sh", "-c"]
args:
- echo $(tasks.add-uid.results.uid)
# - echo $(params.uid)

0 comments on commit e98fecb

Please sign in to comment.