-
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.
This POC illustrates propagating workspaces defined at the `pipelinerun` stage and directly referred at the `spec`. There is no need to specify it in the `pipelinespec` followed by `tasks` and `taskspec`.
- Loading branch information
1 parent
380dbd0
commit b77584a
Showing
11 changed files
with
767 additions
and
53 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
76 changes: 76 additions & 0 deletions
76
examples/v1beta1/pipelineruns/alpha/propagating-workspaces.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,76 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: sensitive-recipe-storage | ||
data: | ||
brownies: | | ||
1. Heat oven to 325 degrees F | ||
2. Melt 1/2 cup butter w/ 1/2 cup cocoa, stirring smooth. | ||
3. Remove from heat, allow to cool for a few minutes. | ||
4. Transfer to bowl. | ||
5. Whisk in 2 eggs, one at a time. | ||
6. Stir in vanilla. | ||
7. Separately combine 1 cup sugar, 1/4 cup flour, 1 cup chopped | ||
walnuts and pinch of salt | ||
8. Combine mixtures. | ||
9. Bake in greased pan for 30 minutes. Watch carefully for | ||
appropriate level of gooeyness. | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: secret-password | ||
type: Opaque | ||
data: | ||
password: aHVudGVyMg== | ||
--- | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: PipelineRun | ||
metadata: | ||
generateName: recipe-time- | ||
spec: | ||
params: | ||
- name: filename | ||
value: recipe.txt | ||
workspaces: | ||
- name: shared-data | ||
volumeClaimTemplate: | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 16Mi | ||
volumeMode: Filesystem | ||
- name: recipe-store | ||
configMap: | ||
name: sensitive-recipe-storage | ||
items: | ||
- key: brownies | ||
path: recipe.txt | ||
- name: password-vault | ||
secret: | ||
secretName: secret-password | ||
pipelineSpec: | ||
tasks: | ||
- name: fetch-secure-data | ||
taskSpec: | ||
steps: | ||
- name: fetch-and-write-secure | ||
image: ubuntu | ||
script: | | ||
if [ "hunter2" = "$(cat $(workspaces.password-vault.path)/password)" ]; then | ||
cp $(workspaces.recipe-store.path)/recipe.txt $(workspaces.shared-data.path) | ||
echo "success!!!" | ||
else | ||
echo "wrong password!" | ||
exit 1 | ||
fi | ||
- name: print-the-recipe | ||
runAfter: | ||
- fetch-secure-data | ||
taskSpec: | ||
steps: | ||
- name: print-secrets | ||
image: ubuntu | ||
script: cat $(workspaces.shared-data.path)/$(params.filename) |
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
Oops, something went wrong.