PipelineResources
⚠️
PipelineResourcesare deprecated.Consider using replacement features instead. Read more in documentation and TEP-0074.
Note:
PipelineResourceshave not been promoted to Beta in tandem with Pipeline’s other CRDs. This means that the level of support forPipelineResourcesremains Alpha.PipelineResourcesare now deprecated.**For Beta-supported alternatives to PipelineResources see the v1alpha1 to v1beta1 migration guide which lists each PipelineResource type and a suggested option for replacing it.
For more information on why PipelineResources are remaining alpha see the description of their problems, along with next steps, below.
Why Aren’t PipelineResources in Beta?
The short answer is that they’re not ready to be given a Beta level of support by Tekton’s developers. The long answer is, well, longer:
-
Their behaviour can be opaque.
They’re implemented as a mixture of injected Task Steps, volume configuration and type-specific code in Tekton Pipeline’s controller. This means errors from
PipelineResourcescan manifest in quite a few different ways and it’s not always obvious whether an error directly relates toPipelineResourcebehaviour. This problem is compounded by the fact that, while our docs explain each Resource type’s “happy path”, there never seems to be enough info available to explain error cases sufficiently. -
When they fail they’re difficult to debug.
Several PipelineResources inject their own Steps before a
Task'sSteps. It’s extremely difficult to manually insert Steps before them to inspect the state of a container before they run. -
There aren’t enough of them.
The six types of existing PipelineResources only cover a tiny subset of the possible systems and side-effects we want to support with Tekton Pipelines.
-
Adding extensibility to them makes them really similar to
Tasks:- User-definable
Steps? This is whatTasksprovide. - User-definable params? Tasks already have these.
- User-definable “resource results”?
TaskshaveTaskResults. - Sharing data between Tasks using PVCs?
workspacesprovide this forTasks.
- User-definable
-
They make
Tasksless reusable.- A
Taskhas to choose thetypeofPipelineResourceit will accept. - If a
Taskaccepts agitPipelineResourcethen it’s not able to accept agcsPipelineResourcefrom aTaskRunorPipelineRuneven though both thegitandgcsPipelineResourcesfetch files. They should technically be interchangeable: all they do is write files from somewhere remote onto disk. Yet with the existingPipelineResourcesimplementation they aren’t interchangeable.
- A
They also present challenges from a documentation perspective:
- Their purpose is ambiguous and it’s difficult to articulate what the CRD is precisely for.
- Four of the types interact with external systems (git, pull-request, gcs, gcs-build).
- Five of them write files to a Task’s disk (git, pull-request, gcs, gcs-build, cluster).
- One tells the Pipelines controller to emit CloudEvents to a specific endpoint (cloudEvent).
- One writes config to disk for a
Taskto use (cluster). - One writes a digest in one
Taskand then reads it back in anotherTask(image). - Perhaps the one thing you can say about the
PipelineResourceCRD is that it can create side-effects for yourTasks.
What’s still missing
So what are PipelineResources still good for? We think we’ve identified some of the most important things:
- You can augment
Task-only workflows withPipelineResourcesthat, without them, can only be done withPipelines.- For example, let’s say you want to checkout a git repo for your Task to test. You have two options. First, you could use a
gitPipelineResource and add it directly to your testTask. Second, you could write aPipelinethat has agit-cloneTaskwhich checks out the code onto a PersistentVolumeClaimworkspaceand then passes that PVCworkspaceto your testTask. For a lot of users the second workflow is totally acceptable but for others it isn’t. Some of the most notable reasons we’ve heard are:- Some users simply cannot allocate storage on their platform, meaning
PersistentVolumeClaimsare out of the question. - Expanding a single
Taskworkflow into aPipelineis labor-intensive and feels unnecessary.
- Some users simply cannot allocate storage on their platform, meaning
- For example, let’s say you want to checkout a git repo for your Task to test. You have two options. First, you could use a
- Despite being difficult to explain the whole CRD clearly each individual
typeis relatively easy to explain.- For example, users can build a pretty good “hunch” for what a
gitPipelineResourceis without really reading any docs.
- For example, users can build a pretty good “hunch” for what a
- Configuring CloudEvents to be emitted by the Tekton Pipelines controller.
- Work is ongoing to get notifications support into the Pipelines controller which should hopefully be able to replace the
cloudEventsPipelineResource.
- Work is ongoing to get notifications support into the Pipelines controller which should hopefully be able to replace the
For each of these there is some amount of ongoing work or discussion. We have deprecated PipelineResources and are
actively working to cover the missing replacement features. Read more about the deprecation in TEP-0074.
For Beta-supported alternatives to PipelineResources see the v1alpha1 to v1beta1 migration guide which lists each PipelineResource type and a suggested option for replacing it.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License.
Feedback
Was this page helpful?