Skip to content

Commit

Permalink
Correct the message for "step" failed in "taskrun"
Browse files Browse the repository at this point in the history
Fix issue: #2518
  • Loading branch information
vincent-pli authored and tekton-robot committed May 6, 2020
1 parent d5a91fd commit 4280425
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/pod/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ func getFailureMessage(pod *corev1.Pod) string {
term := status.State.Terminated
if term != nil && term.ExitCode != 0 {
// Newline required at end to prevent yaml parser from breaking the log help text at 80 chars
return fmt.Sprintf(`%q exited with code %d (image: %q); for logs run: kubectl -n %s logs %s -c %s\n`,
return fmt.Sprintf("%q exited with code %d (image: %q); for logs run: kubectl -n %s logs %s -c %s\n",
status.Name, term.ExitCode, status.ImageID,
pod.Namespace, pod.Name, status.Name)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/pod/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func TestMakeTaskRunStatus(t *testing.T) {
Type: apis.ConditionSucceeded,
Status: corev1.ConditionFalse,
Reason: ReasonFailed,
Message: `"step-failure" exited with code 123 (image: "image-id"); for logs run: kubectl -n foo logs pod -c step-failure\n`,
Message: "\"step-failure\" exited with code 123 (image: \"image-id\"); for logs run: kubectl -n foo logs pod -c step-failure\n",
}},
},
TaskRunStatusFields: v1alpha1.TaskRunStatusFields{
Expand Down Expand Up @@ -653,7 +653,7 @@ func TestMakeTaskRunStatus(t *testing.T) {
Type: apis.ConditionSucceeded,
Status: corev1.ConditionFalse,
Reason: ReasonFailed,
Message: `"step-non-json" exited with code 1 (image: "image"); for logs run: kubectl -n foo logs pod -c step-non-json\n`,
Message: "\"step-non-json\" exited with code 1 (image: \"image\"); for logs run: kubectl -n foo logs pod -c step-non-json\n",
}},
},
TaskRunStatusFields: v1alpha1.TaskRunStatusFields{
Expand Down

0 comments on commit 4280425

Please sign in to comment.