You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use case: Use two instances of a task that writes to the same workspace volume - but
they write to different path of the volume. A typical use case is two git-clone tasks
that clone two git repositories, but the files should be located in two different
directories on the workspace volume.
This commit solves this by adding the `subPath` field to the WorkspacePipelineTaskBinding.
Copy file name to clipboardExpand all lines: docs/workspaces.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -222,6 +222,10 @@ spec:
222
222
- use-ws-from-pipeline # important: use-ws-from-pipeline writes to the workspace first
223
223
```
224
224
225
+
Include a `subPath` in the workspace binding to mount different parts of the same volume for different Tasks. See [a full example of this kind of Pipeline](../examples/v1beta1/pipelineruns/pipelinerun-using-different-subpaths-of-workspace.yaml) which writes data to two adjacent directories on the same Volume.
226
+
227
+
The `subPath` specified in a `Pipeline` will be appended to any `subPath` specified as part of the `PipelineRun` workspace declaration. So a `PipelineRun` declaring a Workspace with `subPath` of `/foo` for a `Pipeline` who binds it to a `Task` with `subPath` of `/bar` will end up mounting the `Volume`'s `/foo/bar` directory.
228
+
225
229
#### Specifying `Workspace` order in a `Pipeline`
226
230
227
231
Sharing a `Workspace` between `Tasks` requires you to define the order in which those `Tasks`
0 commit comments