From 5e530f32ed619ed4e2cdf988a0a5cc999f7a54b3 Mon Sep 17 00:00:00 2001 From: hriships Date: Wed, 29 May 2019 17:49:35 +0200 Subject: [PATCH] Removes build word references from TaskRun At present `TaskRun's` `status`, it's pod containers name(`step name` prefix) and logs has references to `build` keyword. Which kind of gives the perception that `Task` is intended to perform only build operations. This patch removes those references from `TaskRun`. Fixes - https://github.com/tektoncd/pipeline/issues/815 Signed-off-by: Vincent Demeester --- cmd/nop/main.go | 2 +- .../v1alpha1/taskrun/resources/pod.go | 8 +-- .../v1alpha1/taskrun/resources/pod_test.go | 12 ++-- pkg/reconciler/v1alpha1/taskrun/taskrun.go | 4 +- .../v1alpha1/taskrun/taskrun_test.go | 68 +++++++++---------- test/git_checkout_test.go | 2 +- test/kaniko_task_test.go | 2 +- test/taskrun_test.go | 16 ++--- 8 files changed, 57 insertions(+), 57 deletions(-) diff --git a/cmd/nop/main.go b/cmd/nop/main.go index 31343ae727c..befa032366b 100644 --- a/cmd/nop/main.go +++ b/cmd/nop/main.go @@ -19,5 +19,5 @@ package main import "fmt" func main() { - fmt.Println("Build successful") + fmt.Println("Task completed successfully") } diff --git a/pkg/reconciler/v1alpha1/taskrun/resources/pod.go b/pkg/reconciler/v1alpha1/taskrun/resources/pod.go index ef94a8e57a0..dd24fda65b0 100644 --- a/pkg/reconciler/v1alpha1/taskrun/resources/pod.go +++ b/pkg/reconciler/v1alpha1/taskrun/resources/pod.go @@ -90,8 +90,8 @@ const ( // Prefixes to add to the name of the init containers. // IMPORTANT: Changing these values without changing fluentd collection configuration // will break log collection for init containers. - containerPrefix = "build-step-" - unnamedInitContainerPrefix = "build-step-unnamed-" + containerPrefix = "step-" + unnamedInitContainerPrefix = "step-unnamed-" // Name of the credential initialization container. credsInit = "credential-initializer" // Name of the working dir initialization container. @@ -102,9 +102,9 @@ var ( // The container used to initialize credentials before the build runs. credsImage = flag.String("creds-image", "override-with-creds:latest", "The container image for preparing our Build's credentials.") - // The container that just prints build successful. + // The container that just prints Task completed successfully. nopImage = flag.String("nop-image", "override-with-nop:latest", - "The container image run at the end of the build to log build success") + "The container image run at the end of the build to log task success") ) func makeCredentialInitializer(serviceAccountName, namespace string, kubeclient kubernetes.Interface) (*corev1.Container, []corev1.Volume, error) { diff --git a/pkg/reconciler/v1alpha1/taskrun/resources/pod_test.go b/pkg/reconciler/v1alpha1/taskrun/resources/pod_test.go index 4849ba131a1..8d0ccb9e158 100644 --- a/pkg/reconciler/v1alpha1/taskrun/resources/pod_test.go +++ b/pkg/reconciler/v1alpha1/taskrun/resources/pod_test.go @@ -159,7 +159,7 @@ func TestMakePod(t *testing.T) { WorkingDir: workspaceDir, }}, Containers: []corev1.Container{{ - Name: "build-step-name", + Name: "step-name", Image: "image", Env: implicitEnvVars, VolumeMounts: implicitVolumeMounts, @@ -205,7 +205,7 @@ func TestMakePod(t *testing.T) { WorkingDir: workspaceDir, }}, Containers: []corev1.Container{{ - Name: "build-step-name", + Name: "step-name", Image: "image", Env: implicitEnvVars, VolumeMounts: implicitVolumeMounts, @@ -226,7 +226,7 @@ func TestMakePod(t *testing.T) { desc: "very-long-step-name", ts: v1alpha1.TaskSpec{ Steps: []corev1.Container{{ - Name: "a-very-long-character-step-name-to-trigger-max-len----and-invalid-characters", + Name: "a-very-very-long-character-step-name-to-trigger-max-len----and-invalid-characters", Image: "image", }}, }, @@ -245,7 +245,7 @@ func TestMakePod(t *testing.T) { WorkingDir: workspaceDir, }}, Containers: []corev1.Container{{ - Name: "build-step-a-very-long-character-step-name-to-trigger-max-len", + Name: "step-a-very-very-long-character-step-name-to-trigger-max-len", Image: "image", Env: implicitEnvVars, VolumeMounts: implicitVolumeMounts, @@ -285,7 +285,7 @@ func TestMakePod(t *testing.T) { WorkingDir: workspaceDir, }}, Containers: []corev1.Container{{ - Name: "build-step-ends-with-invalid", + Name: "step-ends-with-invalid", Image: "image", Env: implicitEnvVars, VolumeMounts: implicitVolumeMounts, @@ -331,7 +331,7 @@ func TestMakePod(t *testing.T) { WorkingDir: workspaceDir, }}, Containers: []corev1.Container{{ - Name: "build-step-name", + Name: "step-name", Image: "image", Env: implicitEnvVars, VolumeMounts: implicitVolumeMounts, diff --git a/pkg/reconciler/v1alpha1/taskrun/taskrun.go b/pkg/reconciler/v1alpha1/taskrun/taskrun.go index f14de88a184..3a4af550607 100644 --- a/pkg/reconciler/v1alpha1/taskrun/taskrun.go +++ b/pkg/reconciler/v1alpha1/taskrun/taskrun.go @@ -78,7 +78,7 @@ const ( // imageDigestExporterContainerName defines the name of the container that will collect the // built images digest - imageDigestExporterContainerName = "build-step-image-digest-exporter" + imageDigestExporterContainerName = "step-image-digest-exporter" ) // Reconciler implements controller.Reconciler for Configuration resources. @@ -386,7 +386,7 @@ func updateStatusFromPod(taskRun *v1alpha1.TaskRun, pod *corev1.Pod, resourceLis taskRun.Status.SetCondition(&apis.Condition{ Type: apis.ConditionSucceeded, Status: corev1.ConditionUnknown, - Reason: "Building", + Reason: reasonRunning, }) case corev1.PodFailed: msg := getFailureMessage(pod) diff --git a/pkg/reconciler/v1alpha1/taskrun/taskrun_test.go b/pkg/reconciler/v1alpha1/taskrun/taskrun_test.go index 4ecfae85919..14320ce3c13 100644 --- a/pkg/reconciler/v1alpha1/taskrun/taskrun_test.go +++ b/pkg/reconciler/v1alpha1/taskrun/taskrun_test.go @@ -159,7 +159,7 @@ var ( actualOps = append(actualOps, ops...) - return tb.PodInitContainer("build-step-credential-initializer-"+suffix, "override-with-creds:latest", actualOps...) + return tb.PodInitContainer("step-credential-initializer-"+suffix, "override-with-creds:latest", actualOps...) } getPlaceToolsInitContainer = func(ops ...tb.ContainerOp) tb.PodSpecOp { @@ -175,7 +175,7 @@ var ( actualOps = append(actualOps, ops...) - return tb.PodInitContainer("build-step-place-tools", "override-with-entrypoint:latest", actualOps...) + return tb.PodInitContainer("step-place-tools", "override-with-entrypoint:latest", actualOps...) } ) @@ -381,7 +381,7 @@ func TestReconcile(t *testing.T) { tb.PodRestartPolicy(corev1.RestartPolicyNever), getCredentialsInitContainer("9l9zj"), getPlaceToolsInitContainer(), - tb.PodContainer("build-step-simple-step", "foo", + tb.PodContainer("step-simple-step", "foo", tb.Command(entrypointLocation), tb.Args("-wait_file", "", "-post_file", "/builder/tools/0", "-entrypoint", "/mycmd", "--"), tb.WorkingDir(workspaceDir), @@ -417,7 +417,7 @@ func TestReconcile(t *testing.T) { tb.PodRestartPolicy(corev1.RestartPolicyNever), getCredentialsInitContainer("9l9zj"), getPlaceToolsInitContainer(), - tb.PodContainer("build-step-sa-step", "foo", + tb.PodContainer("step-sa-step", "foo", tb.Command(entrypointLocation), tb.Args("-wait_file", "", "-post_file", "/builder/tools/0", "-entrypoint", "/mycmd", "--"), tb.WorkingDir(workspaceDir), @@ -461,7 +461,7 @@ func TestReconcile(t *testing.T) { tb.PodRestartPolicy(corev1.RestartPolicyNever), getCredentialsInitContainer("78c5n"), getPlaceToolsInitContainer(), - tb.PodContainer("build-step-git-source-git-resource-mssqb", "override-with-git:latest", + tb.PodContainer("step-git-source-git-resource-mssqb", "override-with-git:latest", tb.Command(entrypointLocation), tb.Args("-wait_file", "", "-post_file", "/builder/tools/0", "-entrypoint", "/ko-app/git-init", "--", "-url", "https://foo.git", "-revision", "master", "-path", "/workspace/workspace"), @@ -476,7 +476,7 @@ func TestReconcile(t *testing.T) { tb.EphemeralStorage("0"), )), ), - tb.PodContainer("build-step-mycontainer", "myimage", + tb.PodContainer("step-mycontainer", "myimage", tb.Command(entrypointLocation), tb.Args("-wait_file", "/builder/tools/0", "-post_file", "/builder/tools/1", "-entrypoint", "/mycmd", "--", "--my-arg=foo", "--my-arg-with-default=bar", "--my-arg-with-default2=thedefault", @@ -492,7 +492,7 @@ func TestReconcile(t *testing.T) { tb.EphemeralStorage("0"), )), ), - tb.PodContainer("build-step-image-digest-exporter-mycontainer-9l9zj", "override-with-imagedigest-exporter-image:latest", + tb.PodContainer("step-image-digest-exporter-mycontainer-9l9zj", "override-with-imagedigest-exporter-image:latest", tb.Command("/builder/tools/entrypoint"), tb.Args("-wait_file", "/builder/tools/1", "-post_file", "/builder/tools/2", "-entrypoint", "/ko-app/imagedigestexporter", "--", "-images", "[{\"name\":\"image-resource\",\"type\":\"image\",\"url\":\"gcr.io/kristoff/sven\",\"digest\":\"\",\"OutputImageDir\":\"\"}]"), @@ -507,7 +507,7 @@ func TestReconcile(t *testing.T) { tb.EphemeralStorage("0"), )), ), - tb.PodContainer("build-step-myothercontainer", "myotherimage", + tb.PodContainer("step-myothercontainer", "myotherimage", tb.Command(entrypointLocation), tb.Args("-wait_file", "/builder/tools/2", "-post_file", "/builder/tools/3", "-entrypoint", "/mycmd", "--", "--my-other-arg=https://foo.git"), @@ -522,7 +522,7 @@ func TestReconcile(t *testing.T) { tb.EphemeralStorage("0"), )), ), - tb.PodContainer("build-step-image-digest-exporter-myothercontainer-mz4c7", "override-with-imagedigest-exporter-image:latest", + tb.PodContainer("step-image-digest-exporter-myothercontainer-mz4c7", "override-with-imagedigest-exporter-image:latest", tb.Command(entrypointLocation), tb.Args("-wait_file", "/builder/tools/3", "-post_file", "/builder/tools/4", "-entrypoint", "/ko-app/imagedigestexporter", "--", "-images", "[{\"name\":\"image-resource\",\"type\":\"image\",\"url\":\"gcr.io/kristoff/sven\",\"digest\":\"\",\"OutputImageDir\":\"\"}]"), @@ -566,7 +566,7 @@ func TestReconcile(t *testing.T) { tb.PodRestartPolicy(corev1.RestartPolicyNever), getCredentialsInitContainer("vr6ds"), getPlaceToolsInitContainer(), - tb.PodContainer("build-step-create-dir-another-git-resource-78c5n", "override-with-bash-noop:latest", + tb.PodContainer("step-create-dir-another-git-resource-78c5n", "override-with-bash-noop:latest", tb.Command(entrypointLocation), tb.Args("-wait_file", "", "-post_file", "/builder/tools/0", "-entrypoint", "/ko-app/bash", "--", "-args", "mkdir -p /workspace/another-git-resource"), @@ -581,7 +581,7 @@ func TestReconcile(t *testing.T) { tb.EphemeralStorage("0"), )), ), - tb.PodContainer("build-step-source-copy-another-git-resource-mssqb", "override-with-bash-noop:latest", + tb.PodContainer("step-source-copy-another-git-resource-mssqb", "override-with-bash-noop:latest", tb.Command(entrypointLocation), tb.Args("-wait_file", "/builder/tools/0", "-post_file", "/builder/tools/1", "-entrypoint", "/ko-app/bash", "--", "-args", "cp -r source-folder/. /workspace/another-git-resource"), @@ -597,7 +597,7 @@ func TestReconcile(t *testing.T) { tb.EphemeralStorage("0"), )), ), - tb.PodContainer("build-step-create-dir-git-resource-mz4c7", "override-with-bash-noop:latest", + tb.PodContainer("step-create-dir-git-resource-mz4c7", "override-with-bash-noop:latest", tb.Command(entrypointLocation), tb.Args("-wait_file", "/builder/tools/1", "-post_file", "/builder/tools/2", "-entrypoint", "/ko-app/bash", "--", "-args", "mkdir -p /workspace/git-resource"), @@ -612,7 +612,7 @@ func TestReconcile(t *testing.T) { tb.EphemeralStorage("0"), )), ), - tb.PodContainer("build-step-source-copy-git-resource-9l9zj", "override-with-bash-noop:latest", + tb.PodContainer("step-source-copy-git-resource-9l9zj", "override-with-bash-noop:latest", tb.Command(entrypointLocation), tb.Args("-wait_file", "/builder/tools/2", "-post_file", "/builder/tools/3", "-entrypoint", "/ko-app/bash", "--", "-args", "cp -r source-folder/. /workspace/git-resource"), @@ -628,7 +628,7 @@ func TestReconcile(t *testing.T) { tb.EphemeralStorage("0"), )), ), - tb.PodContainer("build-step-simple-step", "foo", + tb.PodContainer("step-simple-step", "foo", tb.Command(entrypointLocation), tb.Args("-wait_file", "/builder/tools/3", "-post_file", "/builder/tools/4", "-entrypoint", "/mycmd", "--"), tb.WorkingDir(workspaceDir), @@ -642,7 +642,7 @@ func TestReconcile(t *testing.T) { tb.EphemeralStorage("0"), )), ), - tb.PodContainer("build-step-source-mkdir-git-resource-6nl7g", "override-with-bash-noop:latest", + tb.PodContainer("step-source-mkdir-git-resource-6nl7g", "override-with-bash-noop:latest", tb.Command(entrypointLocation), tb.Args("-wait_file", "/builder/tools/4", "-post_file", "/builder/tools/5", "-entrypoint", "/ko-app/bash", "--", "-args", "mkdir -p output-folder"), @@ -658,7 +658,7 @@ func TestReconcile(t *testing.T) { tb.EphemeralStorage("0"), )), ), - tb.PodContainer("build-step-source-copy-git-resource-j2tds", "override-with-bash-noop:latest", + tb.PodContainer("step-source-copy-git-resource-j2tds", "override-with-bash-noop:latest", tb.Command(entrypointLocation), tb.Args("-wait_file", "/builder/tools/5", "-post_file", "/builder/tools/6", "-entrypoint", "/ko-app/bash", "--", "-args", "cp -r /workspace/git-resource/. output-folder"), @@ -694,7 +694,7 @@ func TestReconcile(t *testing.T) { tb.PodRestartPolicy(corev1.RestartPolicyNever), getCredentialsInitContainer("mz4c7"), getPlaceToolsInitContainer(), - tb.PodContainer("build-step-git-source-git-resource-9l9zj", "override-with-git:latest", + tb.PodContainer("step-git-source-git-resource-9l9zj", "override-with-git:latest", tb.Command(entrypointLocation), tb.Args("-wait_file", "", "-post_file", "/builder/tools/0", "-entrypoint", "/ko-app/git-init", "--", "-url", "https://foo.git", "-revision", "master", "-path", "/workspace/workspace"), @@ -709,7 +709,7 @@ func TestReconcile(t *testing.T) { tb.EphemeralStorage("0"), )), ), - tb.PodContainer("build-step-mycontainer", "myimage", + tb.PodContainer("step-mycontainer", "myimage", tb.Command(entrypointLocation), tb.WorkingDir(workspaceDir), tb.Args("-wait_file", "/builder/tools/0", "-post_file", "/builder/tools/1", "-entrypoint", "/mycmd", "--", @@ -745,7 +745,7 @@ func TestReconcile(t *testing.T) { tb.PodRestartPolicy(corev1.RestartPolicyNever), getCredentialsInitContainer("9l9zj"), getPlaceToolsInitContainer(), - tb.PodContainer("build-step-simple-step", "foo", + tb.PodContainer("step-simple-step", "foo", tb.Command(entrypointLocation), tb.Args("-wait_file", "", "-post_file", "/builder/tools/0", "-entrypoint", "/mycmd", "--"), tb.WorkingDir(workspaceDir), @@ -779,7 +779,7 @@ func TestReconcile(t *testing.T) { tb.PodRestartPolicy(corev1.RestartPolicyNever), getCredentialsInitContainer("mz4c7"), getPlaceToolsInitContainer(), - tb.PodContainer("build-step-git-source-workspace-9l9zj", "override-with-git:latest", + tb.PodContainer("step-git-source-workspace-9l9zj", "override-with-git:latest", tb.Command(entrypointLocation), tb.Args("-wait_file", "", "-post_file", "/builder/tools/0", "-entrypoint", "/ko-app/git-init", "--", "-url", "github.com/foo/bar.git", "-revision", "rel-can", "-path", @@ -795,7 +795,7 @@ func TestReconcile(t *testing.T) { tb.EphemeralStorage("0"), )), ), - tb.PodContainer("build-step-mystep", "ubuntu", + tb.PodContainer("step-mystep", "ubuntu", tb.Command(entrypointLocation), tb.Args("-wait_file", "/builder/tools/0", "-post_file", "/builder/tools/1", "-entrypoint", "/mycmd", "--"), tb.WorkingDir(workspaceDir), @@ -831,7 +831,7 @@ func TestReconcile(t *testing.T) { tb.PodRestartPolicy(corev1.RestartPolicyNever), getCredentialsInitContainer("9l9zj"), getPlaceToolsInitContainer(), - tb.PodContainer("build-step-simple-step", "foo", + tb.PodContainer("step-simple-step", "foo", tb.Command(entrypointLocation), tb.Args("-wait_file", "", "-post_file", "/builder/tools/0", "-entrypoint", "/mycmd", "--"), tb.WorkingDir(workspaceDir), @@ -867,7 +867,7 @@ func TestReconcile(t *testing.T) { tb.PodRestartPolicy(corev1.RestartPolicyNever), getCredentialsInitContainer("9l9zj"), getPlaceToolsInitContainer(), - tb.PodContainer("build-step-simple-step", "foo", + tb.PodContainer("step-simple-step", "foo", tb.Command(entrypointLocation), tb.Args("-wait_file", "", "-post_file", "/builder/tools/0", "-entrypoint", "/mycmd", "--"), tb.WorkingDir(workspaceDir), @@ -902,7 +902,7 @@ func TestReconcile(t *testing.T) { tb.PodRestartPolicy(corev1.RestartPolicyNever), getCredentialsInitContainer("9l9zj", tb.EnvVar("FRUIT", "APPLE")), getPlaceToolsInitContainer(tb.EnvVar("FRUIT", "APPLE")), - tb.PodContainer("build-step-env-step", "foo", tb.Command(entrypointLocation), + tb.PodContainer("step-env-step", "foo", tb.Command(entrypointLocation), tb.Command(entrypointLocation), tb.Args("-wait_file", "", "-post_file", "/builder/tools/0", "-entrypoint", "/mycmd", "--"), tb.WorkingDir(workspaceDir), @@ -939,7 +939,7 @@ func TestReconcile(t *testing.T) { tb.PodRestartPolicy(corev1.RestartPolicyNever), getCredentialsInitContainer("9l9zj"), getPlaceToolsInitContainer(), - tb.PodContainer("build-step-step1", "foo", + tb.PodContainer("step-step1", "foo", tb.Command(entrypointLocation), tb.Args("-wait_file", "", "-post_file", "/builder/tools/0", "-entrypoint", "/mycmd", "--"), tb.WorkingDir(workspaceDir), @@ -959,7 +959,7 @@ func TestReconcile(t *testing.T) { ), ), ), - tb.PodContainer("build-step-step2", "foo", + tb.PodContainer("step-step2", "foo", tb.Command(entrypointLocation), tb.Args("-wait_file", "/builder/tools/0", "-post_file", "/builder/tools/1", "-entrypoint", "/mycmd", "--"), tb.WorkingDir(workspaceDir), @@ -976,7 +976,7 @@ func TestReconcile(t *testing.T) { ), ), ), - tb.PodContainer("build-step-step3", "foo", + tb.PodContainer("step-step3", "foo", tb.Command(entrypointLocation), tb.Args("-wait_file", "/builder/tools/1", "-post_file", "/builder/tools/2", "-entrypoint", "/mycmd", "--"), tb.WorkingDir(workspaceDir), @@ -1011,7 +1011,7 @@ func TestReconcile(t *testing.T) { tb.PodRestartPolicy(corev1.RestartPolicyNever), getCredentialsInitContainer("9l9zj"), getPlaceToolsInitContainer(), - tb.PodContainer("build-step-simple-step", "foo", + tb.PodContainer("step-simple-step", "foo", tb.Command(entrypointLocation), tb.Args("-wait_file", "", "-post_file", "/builder/tools/0", "-entrypoint", "/mycmd", "--"), tb.WorkingDir(workspaceDir), @@ -1486,7 +1486,7 @@ func TestUpdateStatusFromPod(t *testing.T) { conditionBuilding := apis.Condition{ Type: apis.ConditionSucceeded, Status: corev1.ConditionUnknown, - Reason: "Building", + Reason: reasonRunning, } for _, c := range []struct { desc string @@ -1563,7 +1563,7 @@ func TestUpdateStatusFromPod(t *testing.T) { podStatus: corev1.PodStatus{ Phase: corev1.PodSucceeded, ContainerStatuses: []corev1.ContainerStatus{{ - Name: "build-step-build-step-push", + Name: "step-step-push", State: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ ExitCode: 0, @@ -1580,7 +1580,7 @@ func TestUpdateStatusFromPod(t *testing.T) { Terminated: &corev1.ContainerStateTerminated{ ExitCode: 0, }}, - Name: "build-step-push", + Name: "step-push", }}, // We don't actually care about the time, just that it's not nil CompletionTime: &metav1.Time{Time: time.Now()}, @@ -1590,7 +1590,7 @@ func TestUpdateStatusFromPod(t *testing.T) { podStatus: corev1.PodStatus{ Phase: corev1.PodRunning, ContainerStatuses: []corev1.ContainerStatus{{ - Name: "build-step-running-step", + Name: "step-running-step", State: corev1.ContainerState{ Running: &corev1.ContainerStateRunning{}, }, @@ -1615,7 +1615,7 @@ func TestUpdateStatusFromPod(t *testing.T) { // creds-init status; ignored }}, ContainerStatuses: []corev1.ContainerStatus{{ - Name: "build-step-failure", + Name: "step-failure", ImageID: "image-id", State: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ @@ -1629,7 +1629,7 @@ func TestUpdateStatusFromPod(t *testing.T) { Conditions: []apis.Condition{{ Type: apis.ConditionSucceeded, Status: corev1.ConditionFalse, - Message: `"build-step-failure" exited with code 123 (image: "image-id"); for logs run: kubectl -n foo logs pod -c build-step-failure`, + Message: `"step-failure" exited with code 123 (image: "image-id"); for logs run: kubectl -n foo logs pod -c step-failure`, }}, }, Steps: []v1alpha1.StepState{{ diff --git a/test/git_checkout_test.go b/test/git_checkout_test.go index b2167f6f041..4f4af867043 100644 --- a/test/git_checkout_test.go +++ b/test/git_checkout_test.go @@ -115,7 +115,7 @@ func TestGitPipelineRunFail(t *testing.T) { } for _, stat := range p.Status.ContainerStatuses { - if strings.HasPrefix(stat.Name, "build-step-git-source-"+gitSourceResourceName) { + if strings.HasPrefix(stat.Name, "step-git-source-"+gitSourceResourceName) { if stat.State.Terminated != nil { req := c.KubeClient.Kube.CoreV1().Pods(namespace).GetLogs(p.Name, &corev1.PodLogOptions{Container: stat.Name}) logContent, err := req.Do().Raw() diff --git a/test/kaniko_task_test.go b/test/kaniko_task_test.go index b2c0c309a59..2cb612446a6 100644 --- a/test/kaniko_task_test.go +++ b/test/kaniko_task_test.go @@ -40,7 +40,7 @@ const ( kanikoTaskName = "kanikotask" kanikoTaskRunName = "kanikotask-run" kanikoResourceName = "go-example-git" - kanikoBuildOutput = "Build successful" + kanikoBuildOutput = "Task completed successfully" ) func getGitResource(namespace string) *v1alpha1.PipelineResource { diff --git a/test/taskrun_test.go b/test/taskrun_test.go index 2face079266..c2c948871f2 100644 --- a/test/taskrun_test.go +++ b/test/taskrun_test.go @@ -74,19 +74,19 @@ func TestTaskRunFailure(t *testing.T) { expectedStepState := []v1alpha1.StepState{{ ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ - ExitCode: 1, - Reason: "Error", + ExitCode: 0, + Reason: "Completed", }, }, - Name: "exit", + Name: "nop", }, { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ - ExitCode: 0, - Reason: "Completed", + ExitCode: 1, + Reason: "Error", }, }, - Name: "hello", + Name: "exit", }, { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ @@ -94,7 +94,7 @@ func TestTaskRunFailure(t *testing.T) { Reason: "Completed", }, }, - Name: "world", + Name: "hello", }, { ContainerState: corev1.ContainerState{ Terminated: &corev1.ContainerStateTerminated{ @@ -102,7 +102,7 @@ func TestTaskRunFailure(t *testing.T) { Reason: "Completed", }, }, - Name: "nop", + Name: "world", }} ignoreFields := cmpopts.IgnoreFields(corev1.ContainerStateTerminated{}, "StartedAt", "FinishedAt", "ContainerID") if d := cmp.Diff(taskrun.Status.Steps, expectedStepState, ignoreFields); d != "" {