Chapter 7
In this chapter, you learned how to share large quantities of data across tasks in a pipeline. This will be useful when you start dealing with Git repositories. The following exercises will give you some practice with the concept of workspaces.
Write and read
Create a task that uses a workspace to share information across its two steps. The first step will write a message, specified in a parameter, to a file in the workspace. The second step will output the content of the file in the logs. Try running the task using the -w
parameter in the tkn
CLI tool.
Here is a possible solution for the exercise:
apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: write-read-workspace spec: workspaces: - name: data params: - name: message default: "Hello World" type: string ...