-
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.
Prior to this, we allowed parameter propagation in an inlined pipelinerun. However, within a pipeline, we requrie a verbose spec. This was an oversight as indicated in #7901. This PR fixes that issue by updating the validation logic in the webhook. Fixes #7901. Propagate params in pipelines Prior to this, we allowed parameter propagation in an inlined pipelinerun. However, within a pipeline, we requrie a verbose spec. This was an oversight as indicated in #7901. This PR fixes that issue by updating the validation logic in the webhook. Fixes #7901.
- Loading branch information
1 parent
59794e3
commit 21e510f
Showing
6 changed files
with
237 additions
and
4 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
34 changes: 34 additions & 0 deletions
34
examples/v1/pipelineruns/propagating-params-in-pipelines.yaml
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,34 @@ | ||
apiVersion: tekton.dev/v1 | ||
kind: Pipeline | ||
metadata: | ||
name: param-example | ||
spec: | ||
params: | ||
- name: p1 | ||
- name: p2 | ||
tasks: | ||
- name: t1 | ||
taskSpec: | ||
steps: | ||
- image: ubuntu | ||
command: ["echo"] | ||
args: ["$(params.p1)"] | ||
- name: t2 | ||
taskSpec: | ||
steps: | ||
- image: ubuntu | ||
command: ["echo"] | ||
args: ["$(params.p2)"] | ||
--- | ||
apiVersion: tekton.dev/v1 | ||
kind: PipelineRun | ||
metadata: | ||
name: param-example-run | ||
spec: | ||
pipelineRef: | ||
name: param-example | ||
params: | ||
- name: p1 | ||
value: foo | ||
- name: p2 | ||
value: bar |
32 changes: 32 additions & 0 deletions
32
examples/v1/pipelineruns/propagating-workspaces-in-pipelines.yaml
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/v1 | ||
kind: Pipeline | ||
metadata: | ||
name: workspace-example | ||
spec: | ||
workspaces: | ||
- name: shared-data | ||
tasks: | ||
- name: t1 | ||
taskSpec: | ||
steps: | ||
- image: ubuntu | ||
command: ["ls"] | ||
args: ["$(workspaces.shared-data.path)"] | ||
--- | ||
apiVersion: tekton.dev/v1 | ||
kind: PipelineRun | ||
metadata: | ||
name: workspace-example-run | ||
spec: | ||
pipelineRef: | ||
name: workspace-example | ||
workspaces: | ||
- name: shared-data | ||
volumeClaimTemplate: | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 16Mi | ||
volumeMode: Filesystem |
37 changes: 37 additions & 0 deletions
37
examples/v1/pipelineruns/propagating_params_in_pipeline.yaml
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,37 @@ | ||
apiVersion: tekton.dev/v1 | ||
kind: Pipeline | ||
metadata: | ||
name: propagating-params-in-pipeline | ||
spec: | ||
params: | ||
- name: HELLO | ||
default: "Pipeline Hello World!" | ||
tasks: | ||
- name: echo-hello | ||
taskSpec: | ||
steps: | ||
- name: echo | ||
image: ubuntu | ||
script: | | ||
#!/usr/bin/env bash | ||
echo "$(params.HELLO)" | ||
finally: | ||
- name: echo-hello-finally | ||
taskSpec: | ||
steps: | ||
- name: echo | ||
image: ubuntu | ||
script: | | ||
#!/usr/bin/env bash | ||
echo "And Finally ... $(params.HELLO)" | ||
--- | ||
apiVersion: tekton.dev/v1 | ||
kind: PipelineRun | ||
metadata: | ||
generateName: propagating-params-in-pipeline- | ||
spec: | ||
params: | ||
- name: HELLO | ||
value: "Hello from pipeline run" | ||
pipelineRef: | ||
name: propagating-params-in-pipeline |
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