Skip to content

Commit 6ea8888

Browse files
imjasonhtekton-robot
authored andcommitted
Point $HOME to /tekton/home
/builder/home is still mounted, backed by the same volume, to allow users some time to move over before we move /builder/home in v0.10 and beta.
1 parent 93f1933 commit 6ea8888

17 files changed

+119
-70
lines changed

cmd/creds-init/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ data:
3636
```
3737
3838
The flag `-ssh-git=ssh-key=github.com` (with the environment variable
39-
`HOME=/builder/home`) would result with the following files:
39+
`HOME=/tekton/home`) would result with the following files:
4040

4141
- `~/.ssh/config`
4242

4343
```
4444
HostName github.com
45-
IdentityFile /builder/home/.ssh/id_foo
45+
IdentityFile /tekton/home/.ssh/id_foo
4646
Port 22
4747
```
4848
- `~/.ssh/id_rsa` with the content of `ssh-privatekey` decoded
@@ -71,9 +71,9 @@ stringData:
7171
```
7272

7373
The flag `-basic-git=foo=github.com` (with the environment variable
74-
`HOME=/builder/home`) would result of the following files:
74+
`HOME=/tekton/home`) would result of the following files:
7575

76-
- `/builder/home/.gitconfig`
76+
- `/tekton/home/.gitconfig`
7777

7878
```
7979
[credential]
@@ -82,7 +82,7 @@ The flag `-basic-git=foo=github.com` (with the environment variable
8282
username = <username>
8383
```
8484

85-
- `/builder/home/.git-credentials`
85+
- `/tekton/home/.git-credentials`
8686

8787
```
8888
https://<username>:<password>@github.com

docs/auth.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ Note: Because `known_hosts` is a non-standard extension of
431431
### Least privilege
432432

433433
The secrets as outlined here will be stored into `$HOME` (by convention the
434-
volume: `/builder/home`), and will be available to `Source` and all `Steps`.
434+
volume: `/tekton/home`), and will be available to `Source` and all `Steps`.
435435

436436
For sensitive credentials that should not be made available to some steps, do
437437
not use the mechanisms outlined here. Instead, the user should declare an

docs/developers/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ If the image is a private registry, the service account should include an
147147
The `/builder/` namespace is reserved on containers for various system tools,
148148
such as the following:
149149

150-
- The environment variable HOME is set to `/builder/home`, used by the builder
150+
- The environment variable HOME is set to `/tekton/home`, used by the builder
151151
tools and injected on into all of the step containers
152152
- Default location for output-images `/builder/output-images`
153153

docs/taskruns.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ spec:
9090
# specifying DOCKER_CONFIG is required to allow kaniko to detect docker credential
9191
env:
9292
- name: "DOCKER_CONFIG"
93-
value: "/builder/home/.docker/"
93+
value: "/tekton/home/.docker/"
9494
command:
9595
- /kaniko/executor
9696
args:
@@ -377,7 +377,7 @@ spec:
377377
# specifying DOCKER_CONFIG is required to allow kaniko to detect docker credential
378378
env:
379379
- name: "DOCKER_CONFIG"
380-
value: "/builder/home/.docker/"
380+
value: "/tekton/home/.docker/"
381381
command:
382382
- /kaniko/executor
383383
args:

docs/tutorial.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ spec:
182182
# specifying DOCKER_CONFIG is required to allow kaniko to detect docker credential
183183
env:
184184
- name: "DOCKER_CONFIG"
185-
value: "/builder/home/.docker/"
185+
value: "/tekton/home/.docker/"
186186
command:
187187
- /kaniko/executor
188188
args:

examples/pipelineruns/pipelinerun.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ spec:
9696
# specifying DOCKER_CONFIG is required to allow kaniko to detect docker credential
9797
env:
9898
- name: "DOCKER_CONFIG"
99-
value: "/builder/home/.docker/"
99+
value: "/tekton/home/.docker/"
100100
command:
101101
- /kaniko/executor
102102
args:

examples/taskruns/build-push-kaniko.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ spec:
4747
# specifying DOCKER_CONFIG is required to allow kaniko to detect docker credential
4848
env:
4949
- name: "DOCKER_CONFIG"
50-
value: "/builder/home/.docker/"
50+
value: "/tekton/home/.docker/"
5151
command:
5252
- /kaniko/executor
5353
args:

examples/taskruns/home-is-set.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ spec:
1010
command: ['bash']
1111
args:
1212
- '-c'
13-
- '[[ $HOME == /builder/home ]]'
13+
- '[[ $HOME == /tekton/home ]]'

examples/taskruns/home-volume.yaml

+6-5
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,20 @@ spec:
88
- name: write
99
image: ubuntu
1010
command: ['bash']
11-
args: ['-c', 'echo some stuff > /builder/home/stuff']
11+
args: ['-c', 'echo some stuff > /tekton/home/stuff']
1212
- name: read
1313
image: ubuntu
1414
command: ['cat']
15-
args: ['/builder/home/stuff']
15+
args: ['/tekton/home/stuff']
1616
- name: override-homevol
1717
image: ubuntu
1818
command: ['bash']
19-
# /builder/home/stuff *doesn't* exist.
20-
args: ['-c', '[[ ! -f /builder/home/stuff ]]']
19+
# /tekton/home/stuff *doesn't* exist, because the specified volumeMount
20+
# conflicts with it, and the user's explicit declaration wins the tie.
21+
args: ['-c', '[[ ! -f /tekton/home/stuff ]]']
2122
volumeMounts:
2223
- name: empty
23-
mountPath: /builder/home
24+
mountPath: /tekton/home
2425
volumes:
2526
- name: empty
2627
emptyDir: {}
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apiVersion: tekton.dev/v1alpha1
2+
kind: TaskRun
3+
metadata:
4+
generateName: old-home-volume-
5+
spec:
6+
taskSpec:
7+
steps:
8+
- name: write
9+
image: ubuntu
10+
command: ['bash']
11+
args: ['-c', 'echo some stuff > /builder/home/stuff']
12+
- name: read
13+
image: ubuntu
14+
command: ['cat']
15+
args: ['/builder/home/stuff']
16+
- name: override-homevol
17+
image: ubuntu
18+
command: ['bash']
19+
# /tekton/home/stuff *doesn't* exist, because the specified volumeMount
20+
# conflicts with it, and the user's explicit declaration wins the tie.
21+
args: ['-c', '[[ ! -f /builder/home/stuff ]]']
22+
volumeMounts:
23+
- name: empty
24+
mountPath: /builder/home
25+
volumes:
26+
- name: empty
27+
emptyDir: {}

examples/taskruns/task-multiple-output-image.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ spec:
7373
- -ce
7474
- |
7575
set -ex
76-
mkdir -p /builder/home/image-outputs/builtImage1
77-
cat <<EOF > /builder/home/image-outputs/builtImage1/index.json
76+
mkdir -p /tekton/home/image-outputs/builtImage1
77+
cat <<EOF > /tekton/home/image-outputs/builtImage1/index.json
7878
{
7979
"schemaVersion": 2,
8080
"manifests": [
@@ -94,8 +94,8 @@ spec:
9494
- -ce
9595
- |
9696
set -e
97-
mkdir -p /builder/home/image-outputs/builtImage2
98-
cat <<EOF > /builder/home/image-outputs/builtImage2/index.json
97+
mkdir -p /tekton/home/image-outputs/builtImage2
98+
cat <<EOF > /tekton/home/image-outputs/builtImage2/index.json
9999
{
100100
"schemaVersion": 2,
101101
"manifests": [

pkg/pod/pod.go

+10-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ import (
3636

3737
const (
3838
workspaceDir = "/workspace"
39-
homeDir = "/builder/home"
39+
homeDir = "/tekton/home"
40+
oldHomeDir = "/builder/home"
4041

4142
taskRunLabelKey = pipeline.GroupName + pipeline.TaskRunLabelKey
4243
ManagedByLabelKey = "app.kubernetes.io/managed-by"
@@ -59,14 +60,20 @@ var (
5960
Name: "workspace",
6061
MountPath: workspaceDir,
6162
}, {
62-
Name: "home",
63+
Name: "tekton-home",
6364
MountPath: homeDir,
65+
}, {
66+
// Mount the home Volume to both /tekton/home and (old,
67+
// deprecated) /builder/home.
68+
// TODO(#1633): After v0.10, we can remove this old path.
69+
Name: "tekton-home",
70+
MountPath: oldHomeDir,
6471
}}
6572
implicitVolumes = []corev1.Volume{{
6673
Name: "workspace",
6774
VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}},
6875
}, {
69-
Name: "home",
76+
Name: "tekton-home",
7077
VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}},
7178
}}
7279

pkg/pod/workingdir_init_test.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,8 @@ import (
2727

2828
func TestWorkingDirInit(t *testing.T) {
2929
volumeMounts := []corev1.VolumeMount{{
30-
Name: "workspace",
31-
MountPath: "/workspace",
32-
}, {
33-
Name: "home",
34-
MountPath: "/builder/home",
30+
Name: "my-volume-mount",
31+
MountPath: "/blah",
3532
}}
3633

3734
names.TestingSeed()

pkg/reconciler/pipelinerun/resources/pipelinerunresolution_test.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -1412,12 +1412,14 @@ func TestResolveConditionChecks(t *testing.T) {
14121412
{
14131413
name: "conditionCheck exists",
14141414
getTaskRun: func(name string) (*v1alpha1.TaskRun, error) {
1415-
if name == "pipelinerun-mytask1-9l9zj-always-true-mz4c7" {
1415+
switch name {
1416+
case "pipelinerun-mytask1-9l9zj-always-true-mz4c7":
14161417
return cc, nil
1417-
} else if name == "pipelinerun-mytask1-9l9zj" {
1418+
case "pipelinerun-mytask1-9l9zj":
14181419
return &trs[0], nil
1420+
default:
1421+
return nil, xerrors.Errorf("getTaskRun called with unexpected name %s", name)
14191422
}
1420-
return nil, xerrors.Errorf("getTaskRun called with unexpected name %s", name)
14211423
},
14221424
expectedConditionCheck: TaskConditionCheckState{{
14231425
ConditionCheckName: "pipelinerun-mytask1-9l9zj-always-true-mz4c7",

0 commit comments

Comments
 (0)