-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add variable substitution for PVC name #2506
Add variable substitution for PVC name #2506
Conversation
There may be use cases when a Task should initiate a PipelineRun or TaskRun. It can be beneficial to use the **same PVC** in the PipelineRun or TaskRun that is initiated, e.g. populated with cached data or a cloned git repository. When using a workspace with a PersistentVolumeClaim as volume source, the name of the PVC is known, and can be passed as a _param_ in the PipelineRun or TaskRun. But when a VolumeClaimTemplate is used as a volume source, the name is generated. In such use cases, it is useful to be able to "look up" the PVC name using variable substitution. Fixes tektoncd#2505
Hi @jlpettersson. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/meow
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
/lgtm
/kind feature |
The access mode configured for a PVC that is used as a workspace volume source may affect how a pipeline is executed, this is not well documented. This commit intend to improve the documentation about this and also provide an example on how to run parallel tasks when using PVC with ReadWriteOnce access mode. - Document how access mode affect task ordering in pipeline under "Specifying Workspace order in a Pipeline" - Provide a full pipeline example of how to use parallel tasks when using a PVC with access mode ReadWriteOnce - We we did provide a "PipelineRun example" under "Example PipelineRun definitions using Workspaces". This commit provide a full PipelineRun example using a workspace. Instead of providing examples of different volume sources here, examples on how to use different VolumeSources is moved to "Specifying VolumeSources in Workspaces" - The VolumeSources persistentVolumeClaim and volumeClaimTemplate both is a PVC, and PVCs has its own peculiarities, e.g. access mode that we document. Both PVC volume sources is moved to a section so we can document the common peculiarities in a single place - Add the workspace variable introduced in tektoncd#2506
The access mode configured for a PVC that is used as a workspace volume source may affect how a pipeline is executed, this is not well documented. This commit intend to improve the documentation about this and also provide an example on how to run parallel tasks when using PVC with ReadWriteOnce access mode. - Document how access mode affect task ordering in pipeline under "Specifying Workspace order in a Pipeline" - Provide a full pipeline example of how to use parallel tasks when using a PVC with access mode ReadWriteOnce - We we did provide a "PipelineRun example" under "Example PipelineRun definitions using Workspaces". This commit provide a full PipelineRun example using a workspace. Instead of providing examples of different volume sources here, examples on how to use different VolumeSources is moved to "Specifying VolumeSources in Workspaces" - The VolumeSources persistentVolumeClaim and volumeClaimTemplate both is a PVC, and PVCs has its own peculiarities, e.g. access mode that we document. Both PVC volume sources is moved to a section so we can document the common peculiarities in a single place - Add the workspace variable introduced in tektoncd#2506
The access mode configured for a PVC that is used as a workspace volume source may affect how a pipeline is executed, this is not well documented. This commit intend to improve the documentation about this and also provide an example on how to run parallel tasks when using PVC with ReadWriteOnce access mode. - Document how access mode affect task ordering in pipeline under "Specifying Workspace order in a Pipeline" - Provide a full pipeline example of how to use parallel tasks when using a PVC with access mode ReadWriteOnce - We we did provide a "PipelineRun example" under "Example PipelineRun definitions using Workspaces". This commit provide a full PipelineRun example using a workspace. Instead of providing examples of different volume sources here, examples on how to use different VolumeSources is moved to "Specifying VolumeSources in Workspaces" - The VolumeSources persistentVolumeClaim and volumeClaimTemplate both is a PVC, and PVCs has its own peculiarities, e.g. access mode that we document. Both PVC volume sources is moved to a section so we can document the common peculiarities in a single place - Add the workspace variable introduced in tektoncd#2506
The access mode configured for a PVC that is used as a workspace volume source may affect how a pipeline is executed, this is not well documented. This commit intend to improve the documentation about this and also provide an example on how to run parallel tasks when using PVC with ReadWriteOnce access mode. - Document how access mode affect task ordering in pipeline under "Specifying Workspace order in a Pipeline" - Provide a full pipeline example of how to use parallel tasks when using a PVC with access mode ReadWriteOnce - We we did provide a "PipelineRun example" under "Example PipelineRun definitions using Workspaces". This commit provide a full PipelineRun example using a workspace. Instead of providing examples of different volume sources here, examples on how to use different VolumeSources is moved to "Specifying VolumeSources in Workspaces" - The VolumeSources persistentVolumeClaim and volumeClaimTemplate both is a PVC, and PVCs has its own peculiarities, e.g. access mode that we document. Both PVC volume sources is moved to a section so we can document the common peculiarities in a single place - Add the workspace variable introduced in #2506
Jonas has recently become a regularly contributor. He started with adding a minor [_missing_ `omitempty`](tektoncd/pipeline#2301) and then [proposed some ideas](tektoncd/pipeline#1986 (comment)) around workspaces and PersistentVolumeClaim creation and continued to [elaborate around those ideas](tektoncd/pipeline#1986 (comment)). A sunny day a few days later, he also submitted an [extensive implementation for volumeClaimTemplate](tektoncd/pipeline#2326), corresponding to the idea discussions. A few days later submitted a [small refactoring PR](tektoncd/pipeline#2392), and he also listened to community members that [proposed changes](tektoncd/pipeline#2450) to his implementation about volumeClaimTemplates and did an [implementation for that proposal](tektoncd/pipeline#2453). A rainy day, he also wrote [technical documentation about PVCs](tektoncd/pipeline#2521) including adding an example that caused _flaky_ integration tests for the whole community during multiple days. When he understood his mistake, he submitted a [removal of the example](tektoncd/pipeline#2546) that caused flaky tests. He has also put his toe into Tekton Catalog and [contributed to the buildah task](tektoncd/pipeline#2546). This has followed, mostly with more PRs to the Pipeline project: - tektoncd/pipeline#2460 - tektoncd/pipeline#2491 - tektoncd/pipeline#2502 - tektoncd/pipeline#2506 - tektoncd/pipeline#2632 - tektoncd/pipeline#2633 - tektoncd/pipeline#2634 - tektoncd/pipeline#2636 - tektoncd/pipeline#2601 - tektoncd/pipeline#2630 Jonas is excited about the great community around Tekton and the project! He now would like to join the org.
Jonas has recently become a regularly contributor. He started with adding a minor [_missing_ `omitempty`](tektoncd/pipeline#2301) and then [proposed some ideas](tektoncd/pipeline#1986 (comment)) around workspaces and PersistentVolumeClaim creation and continued to [elaborate around those ideas](tektoncd/pipeline#1986 (comment)). A sunny day a few days later, he also submitted an [extensive implementation for volumeClaimTemplate](tektoncd/pipeline#2326), corresponding to the idea discussions. A few days later submitted a [small refactoring PR](tektoncd/pipeline#2392), and he also listened to community members that [proposed changes](tektoncd/pipeline#2450) to his implementation about volumeClaimTemplates and did an [implementation for that proposal](tektoncd/pipeline#2453). A rainy day, he also wrote [technical documentation about PVCs](tektoncd/pipeline#2521) including adding an example that caused _flaky_ integration tests for the whole community during multiple days. When he understood his mistake, he submitted a [removal of the example](tektoncd/pipeline#2546) that caused flaky tests. He has also put his toe into Tekton Catalog and [contributed to the buildah task](tektoncd/pipeline#2546). This has followed, mostly with more PRs to the Pipeline project: - tektoncd/pipeline#2460 - tektoncd/pipeline#2491 - tektoncd/pipeline#2502 - tektoncd/pipeline#2506 - tektoncd/pipeline#2632 - tektoncd/pipeline#2633 - tektoncd/pipeline#2634 - tektoncd/pipeline#2636 - tektoncd/pipeline#2601 - tektoncd/pipeline#2630 Jonas is excited about the great community around Tekton and the project! He now would like to join the org.
Changes
There may be use cases when a Task should initiate a PipelineRun or TaskRun.
It can be beneficial to use the same PVC in the PipelineRun or TaskRun
that is initiated, e.g. populated with cached data or a cloned git repository.
When using a workspace with a PersistentVolumeClaim as volume source, the name
of the PVC is known, and can be set in the new PipelineRun or
TaskRun. But when a VolumeClaimTemplate is used as a volume source, the name
is generated. In such use cases, it is useful to be able to "look up" the PVC
name using variable substitution.
This commit introduces
$(workspaces.ws-name.claim)
so that it is possible to get the PVC name. This is similar to how it is possible to get the volume name with$(workspaces.ws-name.volume)
Fixes #2505
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Double check this list of stuff that's easy to miss:
cmd
dir, please updatethe release Task to build and release this image.
Reviewer Notes
If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.
Release Notes