diff --git a/pkg/formatted/k8s.go b/pkg/formatted/k8s.go index 00cfb0d43..50829e824 100644 --- a/pkg/formatted/k8s.go +++ b/pkg/formatted/k8s.go @@ -67,7 +67,9 @@ func Condition(c v1.Conditions) string { status = "Running" } - if c[0].Reason != "" && c[0].Reason != status { + if c[0].Reason == "Completed" && status == "Succeeded" { + return ColorStatus(status) + } else if c[0].Reason != "" && c[0].Reason != status { switch c[0].Reason { case "PipelineRunCancelled", "TaskRunCancelled", "Cancelled": return ColorStatus("Cancelled") + "(" + c[0].Reason + ")" diff --git a/pkg/formatted/k8s_test.go b/pkg/formatted/k8s_test.go index 623b2db2a..0ad83a01a 100644 --- a/pkg/formatted/k8s_test.go +++ b/pkg/formatted/k8s_test.go @@ -73,6 +73,15 @@ func TestCondition(t *testing.T) { }}, want: "Running", }, + { + name: "PipelineRunCompleted status reason", + condition: []apis.Condition{{ + Type: apis.ConditionSucceeded, + Status: corev1.ConditionTrue, + Reason: "Completed", + }}, + want: "Succeeded", + }, { name: "PipelineRunCanceled status reason", condition: []apis.Condition{{