Skip to content

Commit

Permalink
use text/template instead of html/template for pipelinerun describe
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhelfand authored and tekton-robot committed Mar 6, 2020
1 parent a5375e1 commit b5d1f0c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ STARTED DURATION STATUS

Message

PipelineRun "pipeline-run" was cancelled
PipelineRun "pipeline-run" was cancelled

Resources

Expand Down
10 changes: 5 additions & 5 deletions pkg/pipelinerun/description/description.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package description

import (
"fmt"
"html/template"
"sort"
"text/tabwriter"
"text/template"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -168,13 +168,13 @@ func hasFailed(pr *v1alpha1.PipelineRun) string {
}

if pr.Status.Conditions[0].Status == corev1.ConditionFalse {
for _, taskrunStatus := range pr.Status.TaskRuns {
if len(taskrunStatus.Status.Conditions) == 0 {
for _, tr := range pr.Status.TaskRuns {
if len(tr.Status.Conditions) == 0 {
continue
}
if taskrunStatus.Status.Conditions[0].Status == corev1.ConditionFalse {
if tr.Status.Conditions[0].Status == corev1.ConditionFalse {
return fmt.Sprintf("%s (%s)", pr.Status.Conditions[0].Message,
taskrunStatus.Status.Conditions[0].Message)
tr.Status.Conditions[0].Message)
}
}
return pr.Status.Conditions[0].Message
Expand Down

0 comments on commit b5d1f0c

Please sign in to comment.