From e98fecb9c531972eef488edd39cad28590be83ba Mon Sep 17 00:00:00 2001 From: qingliu Date: Wed, 10 Jan 2024 15:58:17 +0800 Subject: [PATCH] docs: optimize examples for propagating results The propagate results only works for the embedded tasks, not for the referenced tasks. --- docs/pipelineruns.md | 11 ++-- ...ropagating_results_implicit_resultref.yaml | 50 +++++++++---------- 2 files changed, 27 insertions(+), 34 deletions(-) diff --git a/docs/pipelineruns.md b/docs/pipelineruns.md index 2e7224e55fd..65c57e5bac5 100644 --- a/docs/pipelineruns.md +++ b/docs/pipelineruns.md @@ -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. @@ -808,8 +807,7 @@ spec: taskSpec: steps: args: - echo - 1001 + echo 1001 command: - /bin/sh - -c @@ -830,8 +828,7 @@ status: taskSpec: steps: args: - echo - 1001 + echo 1001 command: /bin/sh -c diff --git a/examples/v1/pipelineruns/propagating_results_implicit_resultref.yaml b/examples/v1/pipelineruns/propagating_results_implicit_resultref.yaml index 35c086393c6..581440638e5 100644 --- a/examples/v1/pipelineruns/propagating_results_implicit_resultref.yaml +++ b/examples/v1/pipelineruns/propagating_results_implicit_resultref.yaml @@ -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) \ No newline at end of file + - 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)