-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Default TaskRun Workspace Bindings to config-default
Currently, users have to completely specify `Workspaces` they don't care about or whose configuration should be entirely in the hands of admins. This PR enables users to specify default `Workspaces` for `TaskRuns`, for example they can use `emptyDir` by default. The `WorkspaceBinding` can be set in the `config-defaults` ConfigMap in `default-task-run-workspace-binding`. Fixes #2398 and partially fixes #2595.
- Loading branch information
1 parent
76f0ed0
commit 116fadd
Showing
10 changed files
with
258 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: test-task | ||
spec: | ||
workspaces: | ||
- name: source | ||
steps: | ||
- name: write-file | ||
image: ubuntu | ||
script: | | ||
echo "Hello, world!" > /workspace/source/hello.txt || exit 0 | ||
- name: read-file | ||
image: ubuntu | ||
script: | | ||
grep "Hello, world" /workspace/source/hello.txt | ||
--- | ||
# Uses default workspace specified in config-defaults | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: TaskRun | ||
metadata: | ||
name: test-taskrun | ||
spec: | ||
taskRef: | ||
name: test-task | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: my-configmap | ||
data: | ||
hello.txt: "Hello, world!" | ||
--- | ||
# Uses provided workspace (not default) | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: TaskRun | ||
metadata: | ||
name: test-taskrun-configmap | ||
spec: | ||
workspaces: | ||
- name: source | ||
configMap: | ||
name: my-configmap | ||
taskRef: | ||
name: test-task |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters