Skip to content

Commit 05046d5

Browse files
committed
Fix log prefix display inconsistency
1 parent dd06e6b commit 05046d5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pkg/taskrun/taskrun.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func SortTasksBySpecOrder(pipelineTasks []v1.PipelineTask, pipelinesTaskRuns map
9090
if n, ok := trNames[ts.Name]; ok {
9191
trStatusFields := pipelinesTaskRuns[n].Status.TaskRunStatusFields
9292
trs = append(trs, Run{
93-
Task: ts.Name,
93+
Task: taskName(ts),
9494
Name: n,
9595
Retries: ts.Retries,
9696
StartTime: trStatusFields.StartTime,
@@ -101,3 +101,10 @@ func SortTasksBySpecOrder(pipelineTasks []v1.PipelineTask, pipelinesTaskRuns map
101101
sort.Sort(trs)
102102
return trs
103103
}
104+
105+
func taskName(task v1.PipelineTask) string {
106+
if task.DisplayName != "" {
107+
return task.DisplayName
108+
}
109+
return task.Name
110+
}

0 commit comments

Comments
 (0)