Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move /builder/{tools,downward,scripts} to /tekton/ #1626

Merged
merged 1 commit into from
Nov 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/pod/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (

const (
toolsVolumeName = "tools"
mountPoint = "/builder/tools"
mountPoint = "/tekton/tools"
entrypointBinary = mountPoint + "/entrypoint"

downwardVolumeName = "downward"
downwardMountPoint = "/builder/downward"
downwardMountPoint = "/tekton/downward"
downwardMountReadyFile = "ready"
ReadyAnnotation = "tekton.dev/ready"
ReadyAnnotationValue = "READY"
Expand Down
12 changes: 6 additions & 6 deletions pkg/pod/entrypoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ func TestOrderContainers(t *testing.T) {
Image: "step-1",
Command: []string{entrypointBinary},
Args: []string{
"-wait_file", "/builder/downward/ready",
"-wait_file", "/tekton/downward/ready",
"-wait_file_content",
"-post_file", "/builder/tools/0",
"-post_file", "/tekton/tools/0",
"-entrypoint", "cmd", "--",
"arg1", "arg2",
},
Expand All @@ -47,8 +47,8 @@ func TestOrderContainers(t *testing.T) {
Image: "step-2",
Command: []string{entrypointBinary},
Args: []string{
"-wait_file", "/builder/tools/0",
"-post_file", "/builder/tools/1",
"-wait_file", "/tekton/tools/0",
"-post_file", "/tekton/tools/1",
"-entrypoint", "cmd1", "--",
"cmd2", "cmd3",
"arg1", "arg2",
Expand All @@ -58,8 +58,8 @@ func TestOrderContainers(t *testing.T) {
Image: "step-3",
Command: []string{entrypointBinary},
Args: []string{
"-wait_file", "/builder/tools/1",
"-post_file", "/builder/tools/2",
"-wait_file", "/tekton/tools/1",
"-post_file", "/tekton/tools/2",
"-entrypoint", "cmd", "--",
"arg1", "arg2",
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/pod/script.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

const (
scriptsVolumeName = "scripts"
scriptsDir = "/builder/scripts"
scriptsDir = "/tekton/scripts"
)

var (
Expand Down
8 changes: 4 additions & 4 deletions pkg/pod/script_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ func TestConvertScripts(t *testing.T) {
Image: shellImage,
TTY: true,
Command: []string{"sh"},
Args: []string{"-c", `tmpfile="/builder/scripts/script-0-mz4c7"
Args: []string{"-c", `tmpfile="/tekton/scripts/script-0-mz4c7"
touch ${tmpfile} && chmod +x ${tmpfile}
cat > ${tmpfile} << 'script-heredoc-randomly-generated-mssqb'
script-1
script-heredoc-randomly-generated-mssqb
tmpfile="/builder/scripts/script-2-78c5n"
tmpfile="/tekton/scripts/script-2-78c5n"
touch ${tmpfile} && chmod +x ${tmpfile}
cat > ${tmpfile} << 'script-heredoc-randomly-generated-6nl7g'
script-3
Expand All @@ -72,13 +72,13 @@ script-heredoc-randomly-generated-6nl7g
}
want := []corev1.Container{{
Image: "step-1",
Command: []string{"/builder/scripts/script-0-mz4c7"},
Command: []string{"/tekton/scripts/script-0-mz4c7"},
VolumeMounts: []corev1.VolumeMount{ScriptsVolumeMount},
}, {
Image: "step-2",
}, {
Image: "step-3",
Command: []string{"/builder/scripts/script-2-78c5n"},
Command: []string{"/tekton/scripts/script-2-78c5n"},
VolumeMounts: append(preExistingVolumeMounts, ScriptsVolumeMount),
}}
if d := cmp.Diff(wantInit, gotInit); d != "" {
Expand Down
78 changes: 39 additions & 39 deletions pkg/reconciler/taskrun/resources/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestMakePod(t *testing.T) {
placeToolsInit := corev1.Container{
Name: "place-tools",
Image: images.EntrypointImage,
Command: []string{"cp", "/ko-app/entrypoint", "/builder/tools/entrypoint"},
Command: []string{"cp", "/ko-app/entrypoint", "/tekton/tools/entrypoint"},
VolumeMounts: []corev1.VolumeMount{pod.ToolsMount},
}

Expand Down Expand Up @@ -86,13 +86,13 @@ func TestMakePod(t *testing.T) {
Containers: []corev1.Container{{
Name: "step-name",
Image: "image",
Command: []string{"/builder/tools/entrypoint"},
Command: []string{"/tekton/tools/entrypoint"},
Args: []string{
"-wait_file",
"/builder/downward/ready",
"/tekton/downward/ready",
"-wait_file_content",
"-post_file",
"/builder/tools/0",
"/tekton/tools/0",
"-entrypoint",
"cmd",
"--",
Expand Down Expand Up @@ -143,13 +143,13 @@ func TestMakePod(t *testing.T) {
Containers: []corev1.Container{{
Name: "step-name",
Image: "image",
Command: []string{"/builder/tools/entrypoint"},
Command: []string{"/tekton/tools/entrypoint"},
Args: []string{
"-wait_file",
"/builder/downward/ready",
"/tekton/downward/ready",
"-wait_file_content",
"-post_file",
"/builder/tools/0",
"/tekton/tools/0",
"-entrypoint",
"cmd",
"--",
Expand Down Expand Up @@ -192,13 +192,13 @@ func TestMakePod(t *testing.T) {
Containers: []corev1.Container{{
Name: "step-name",
Image: "image",
Command: []string{"/builder/tools/entrypoint"},
Command: []string{"/tekton/tools/entrypoint"},
Args: []string{
"-wait_file",
"/builder/downward/ready",
"/tekton/downward/ready",
"-wait_file_content",
"-post_file",
"/builder/tools/0",
"/tekton/tools/0",
"-entrypoint",
"cmd",
"--",
Expand Down Expand Up @@ -237,13 +237,13 @@ func TestMakePod(t *testing.T) {
Containers: []corev1.Container{{
Name: "step-a-very-very-long-character-step-name-to-trigger-max-len", // step name trimmed.
Image: "image",
Command: []string{"/builder/tools/entrypoint"},
Command: []string{"/tekton/tools/entrypoint"},
Args: []string{
"-wait_file",
"/builder/downward/ready",
"/tekton/downward/ready",
"-wait_file_content",
"-post_file",
"/builder/tools/0",
"/tekton/tools/0",
"-entrypoint",
"cmd",
"--",
Expand Down Expand Up @@ -276,13 +276,13 @@ func TestMakePod(t *testing.T) {
Containers: []corev1.Container{{
Name: "step-ends-with-invalid", // invalid suffix removed.
Image: "image",
Command: []string{"/builder/tools/entrypoint"},
Command: []string{"/tekton/tools/entrypoint"},
Args: []string{
"-wait_file",
"/builder/downward/ready",
"/tekton/downward/ready",
"-wait_file_content",
"-post_file",
"/builder/tools/0",
"/tekton/tools/0",
"-entrypoint",
"cmd",
"--",
Expand Down Expand Up @@ -325,13 +325,13 @@ func TestMakePod(t *testing.T) {
Containers: []corev1.Container{{
Name: "step-name",
Image: "image",
Command: []string{"/builder/tools/entrypoint"},
Command: []string{"/tekton/tools/entrypoint"},
Args: []string{
"-wait_file",
"/builder/downward/ready",
"/tekton/downward/ready",
"-wait_file_content",
"-post_file",
"/builder/tools/0",
"/tekton/tools/0",
"-entrypoint",
"cmd",
"--",
Expand Down Expand Up @@ -369,13 +369,13 @@ func TestMakePod(t *testing.T) {
Containers: []corev1.Container{{
Name: "step-primary-name",
Image: "primary-image",
Command: []string{"/builder/tools/entrypoint"},
Command: []string{"/tekton/tools/entrypoint"},
Args: []string{
"-wait_file",
"/builder/downward/ready",
"/tekton/downward/ready",
"-wait_file_content",
"-post_file",
"/builder/tools/0",
"/tekton/tools/0",
"-entrypoint",
"cmd",
"--",
Expand Down Expand Up @@ -428,13 +428,13 @@ func TestMakePod(t *testing.T) {
Containers: []corev1.Container{{
Name: "step-unnamed-0",
Image: "image",
Command: []string{"/builder/tools/entrypoint"},
Command: []string{"/tekton/tools/entrypoint"},
Args: []string{
"-wait_file",
"/builder/downward/ready",
"/tekton/downward/ready",
"-wait_file_content",
"-post_file",
"/builder/tools/0",
"/tekton/tools/0",
"-entrypoint",
"cmd",
"--",
Expand All @@ -452,12 +452,12 @@ func TestMakePod(t *testing.T) {
}, {
Name: "step-unnamed-1",
Image: "image",
Command: []string{"/builder/tools/entrypoint"},
Command: []string{"/tekton/tools/entrypoint"},
Args: []string{
"-wait_file",
"/builder/tools/0",
"/tekton/tools/0",
"-post_file",
"/builder/tools/1",
"/tekton/tools/1",
"-entrypoint",
"cmd",
"--",
Expand Down Expand Up @@ -501,12 +501,12 @@ print("Hello from Python")`,
Image: images.ShellImage,
Command: []string{"sh"},
TTY: true,
Args: []string{"-c", `tmpfile="/builder/scripts/script-0-mz4c7"
Args: []string{"-c", `tmpfile="/tekton/scripts/script-0-mz4c7"
touch ${tmpfile} && chmod +x ${tmpfile}
cat > ${tmpfile} << 'script-heredoc-randomly-generated-mssqb'
echo hello from step one
script-heredoc-randomly-generated-mssqb
tmpfile="/builder/scripts/script-1-78c5n"
tmpfile="/tekton/scripts/script-1-78c5n"
touch ${tmpfile} && chmod +x ${tmpfile}
cat > ${tmpfile} << 'script-heredoc-randomly-generated-6nl7g'
#!/usr/bin/env python
Expand All @@ -517,21 +517,21 @@ script-heredoc-randomly-generated-6nl7g
}, {
Name: "place-tools",
Image: images.EntrypointImage,
Command: []string{"cp", "/ko-app/entrypoint", "/builder/tools/entrypoint"},
Command: []string{"cp", "/ko-app/entrypoint", "/tekton/tools/entrypoint"},
VolumeMounts: []corev1.VolumeMount{pod.ToolsMount},
}},
Containers: []corev1.Container{{
Name: "step-one",
Image: "image",
Command: []string{"/builder/tools/entrypoint"},
Command: []string{"/tekton/tools/entrypoint"},
Args: []string{
"-wait_file",
"/builder/downward/ready",
"/tekton/downward/ready",
"-wait_file_content",
"-post_file",
"/builder/tools/0",
"/tekton/tools/0",
"-entrypoint",
"/builder/scripts/script-0-mz4c7",
"/tekton/scripts/script-0-mz4c7",
"--",
},
Env: implicitEnvVars,
Expand All @@ -547,14 +547,14 @@ script-heredoc-randomly-generated-6nl7g
}, {
Name: "step-two",
Image: "image",
Command: []string{"/builder/tools/entrypoint"},
Command: []string{"/tekton/tools/entrypoint"},
Args: []string{
"-wait_file",
"/builder/tools/0",
"/tekton/tools/0",
"-post_file",
"/builder/tools/1",
"/tekton/tools/1",
"-entrypoint",
"/builder/scripts/script-1-78c5n",
"/tekton/scripts/script-1-78c5n",
"--",
},
Env: implicitEnvVars,
Expand Down
Loading