Skip to content
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

Ability to look up the PVC name #2505

Closed
jlpettersson opened this issue Apr 28, 2020 · 0 comments · Fixed by #2506
Closed

Ability to look up the PVC name #2505

jlpettersson opened this issue Apr 28, 2020 · 0 comments · Fixed by #2506
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@jlpettersson
Copy link
Member

Expected Behavior

That I can "look up" the PVC name for a workspace using variable substitution.

Use case
In larger organizations using Microservice architecture and Kubernetes, it is common to organize for autonomous application teams and platform teams. For compliance, application teams may not have direct access to production environments, but only through a CI/CD system. When using this team organization, it is benificial if app-teams can define the CI/CD pipeline in their application git repository, similar to e.g. a Jenkinsfile or cloudbuild.yaml. When adopting Tekton, we have created our own pipeline.yaml DSL file. Our setup is as follows (also e.g. Jenkins X is architected for such usage).

Trigger -> Pipeline{ Task(git-clone to workspace) -> Task(parse pipeline.yaml and generate Pipeline and initiate PipelineRun for the generated Pipeline } 

In the Pipeline above, the first task clones the repository to a workspace volume and then a new pipeline+run is generated, it would be useful if we can reuse the workspace instead of doing a second identical git clone again.

It would be very useful if I could use variable substitution to "look up" the PVC name for the workspace in this use case, e.g. with $(workspaces.ws-name.claim). Similar to how I can use $(workspaces.ws-name.volume) to get the volume name in a TaskRun.

Actual Behavior

When using PersistentVolumeClaim as a volume source for a workspace, the PVC name is already known. But when using VolumeClaimTemplate as a volume source, there is no way to "look up" the PVC name.

/kind feature
/assign

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 28, 2020
jlpettersson added a commit to jlpettersson/pipeline that referenced this issue Apr 28, 2020
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
tekton-robot pushed a commit that referenced this issue Apr 29, 2020
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 #2505
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants