Skip to content

Commit bef67c7

Browse files
chmoueltekton-robot
authored andcommitted
fix: update Pending color of PipelineRunPending
- Changed Pending status color from blue to yellow for better clarity - Added explicit handling for PipelineRunPending status to display as Pending - Updated tests to cover PipelineRunPending condition
1 parent 4ecba36 commit bef67c7

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

pkg/cmd/pipelinerun/delete_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ func TestPipelineRunDelete_v1beta1(t *testing.T) {
635635
input: seeds[15].pipelineClient,
636636
inputStream: nil,
637637
wantError: false,
638-
want: "NAME STARTED DURATION STATUS\npipeline-run-4 --- --- ---\npipeline-run-5 --- --- Succeeded(PipelineRunPending)\npipeline-run-6 0 seconds ago --- Succeeded(Running)\npipeline-run-7 0 seconds ago --- Running(PipelineRunPending)\n",
638+
want: "NAME STARTED DURATION STATUS\npipeline-run-4 --- --- ---\npipeline-run-5 --- --- Pending\npipeline-run-6 0 seconds ago --- Succeeded(Running)\npipeline-run-7 0 seconds ago --- Pending\n",
639639
},
640640
}
641641

@@ -1267,7 +1267,7 @@ func TestPipelineRunDelete(t *testing.T) {
12671267
input: seeds[15].pipelineClient,
12681268
inputStream: nil,
12691269
wantError: false,
1270-
want: "NAME STARTED DURATION STATUS\npipeline-run-4 --- --- ---\npipeline-run-5 --- --- Succeeded(PipelineRunPending)\npipeline-run-6 0 seconds ago --- Succeeded(Running)\npipeline-run-7 0 seconds ago --- Running(PipelineRunPending)\n",
1270+
want: "NAME STARTED DURATION STATUS\npipeline-run-4 --- --- ---\npipeline-run-5 --- --- Pending\npipeline-run-6 0 seconds ago --- Succeeded(Running)\npipeline-run-7 0 seconds ago --- Pending\n",
12711271
},
12721272
}
12731273

pkg/formatted/k8s.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var ConditionColor = map[string]color.Attribute{
2929
"Running": color.FgHiBlue,
3030
"Cancelled": color.FgHiYellow,
3131
"Completed": color.FgHiMagenta,
32-
"Pending": color.FgHiBlue,
32+
"Pending": color.FgHiYellow,
3333
"Started": color.FgHiCyan,
3434
}
3535

@@ -86,6 +86,8 @@ func Condition(c v1.Conditions) string {
8686
return ColorStatus("Pending")
8787
}
8888
return ColorStatus("Pending") + "(" + c[0].Reason + ")"
89+
case "PipelineRunPending":
90+
return ColorStatus("Pending")
8991
default:
9092
return ColorStatus(status) + "(" + c[0].Reason + ")"
9193
}

pkg/formatted/k8s_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,15 @@ func TestCondition(t *testing.T) {
8282
}},
8383
want: "Succeeded",
8484
},
85+
{
86+
name: "PipelineRunPending status reason",
87+
condition: []apis.Condition{{
88+
Type: apis.ConditionSucceeded,
89+
Status: corev1.ConditionTrue,
90+
Reason: "PipelineRunPending",
91+
}},
92+
want: "Pending",
93+
},
8594
{
8695
name: "PipelineRunCanceled status reason",
8796
condition: []apis.Condition{{

0 commit comments

Comments
 (0)