Skip to content

Commit c8d9c74

Browse files
authored
Merge pull request #12729 from irapandey/clusterctl_12666
🐛 Removing Ready/Available prefix from STATUS Column
2 parents dc25710 + ff11487 commit c8d9c74

File tree

2 files changed

+43
-43
lines changed

2 files changed

+43
-43
lines changed

internal/util/tree/tree.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ func newRowDescriptor(obj ctrlclient.Object) rowDescriptor {
551551

552552
if available := tree.GetAvailableCondition(obj); available != nil {
553553
availableColor, availableStatus, availableAge, availableReason, availableMessage := conditionInfo(*available, true)
554-
v.status = availableColor.Sprintf("Available: %s", availableStatus)
554+
v.status = availableColor.Sprintf("%s", availableStatus)
555555
v.reason = availableReason
556556
v.age = availableAge
557557
v.message = availableMessage
@@ -574,7 +574,7 @@ func newRowDescriptor(obj ctrlclient.Object) rowDescriptor {
574574

575575
if available := tree.GetAvailableCondition(obj); available != nil {
576576
availableColor, availableStatus, availableAge, availableReason, availableMessage := conditionInfo(*available, true)
577-
v.status = availableColor.Sprintf("Available: %s", availableStatus)
577+
v.status = availableColor.Sprintf("%s", availableStatus)
578578
v.reason = availableReason
579579
v.age = availableAge
580580
v.message = availableMessage
@@ -611,7 +611,7 @@ func newRowDescriptor(obj ctrlclient.Object) rowDescriptor {
611611
v.readyCounters = "0"
612612
if ready := tree.GetReadyCondition(obj); ready != nil {
613613
readyColor, readyStatus, readyAge, readyReason, readyMessage := conditionInfo(*ready, true)
614-
v.status = readyColor.Sprintf("Ready: %s", readyStatus)
614+
v.status = readyColor.Sprintf("%s", readyStatus)
615615
v.reason = readyReason
616616
v.age = readyAge
617617
v.message = readyMessage
@@ -634,7 +634,7 @@ func newRowDescriptor(obj ctrlclient.Object) rowDescriptor {
634634
// corresponding replica counters.
635635
if ready := tree.GetReadyCondition(obj); ready != nil {
636636
readyColor, readyStatus, readyAge, readyReason, readyMessage := conditionInfo(*ready, true)
637-
v.status = readyColor.Sprintf("Ready: %s", readyStatus)
637+
v.status = readyColor.Sprintf("%s", readyStatus)
638638
v.reason = readyReason
639639
v.age = readyAge
640640
v.message = readyMessage
@@ -671,7 +671,7 @@ func newRowDescriptor(obj ctrlclient.Object) rowDescriptor {
671671

672672
if ready := tree.GetReadyCondition(obj); ready != nil {
673673
readyColor, readyStatus, readyAge, readyReason, readyMessage := conditionInfo(*ready, true)
674-
v.status = readyColor.Sprintf("Ready: %s", readyStatus)
674+
v.status = readyColor.Sprintf("%s", readyStatus)
675675
v.reason = readyReason
676676
v.age = readyAge
677677
v.message = readyMessage

internal/util/tree/tree_test.go

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -328,12 +328,12 @@ func Test_TreePrefix(t *testing.T) {
328328
return objectTree
329329
}(),
330330
expectPrefix: []string{
331-
"Object/root Available: False NotAvailable",
332-
"│ second line",
333-
"├─Object/child1 Available: False NotAvailable",
334-
"│ second line",
335-
"└─Object/child2 Available: False NotAvailable",
336-
" second line",
331+
"Object/root False NotAvailable",
332+
"│ second line",
333+
"├─Object/child1 False NotAvailable",
334+
"│ second line",
335+
"└─Object/child2 False NotAvailable",
336+
" second line",
337337
},
338338
},
339339
{
@@ -362,10 +362,10 @@ func Test_TreePrefix(t *testing.T) {
362362
return obectjTree
363363
}(),
364364
expectPrefix: []string{
365-
"Object/root Available: True Available",
366-
"├─Object/child1 Available: True Available",
367-
"└─Object/child2 Available: False NotAvailable",
368-
" │ second line",
365+
"Object/root True Available",
366+
"├─Object/child1 True Available",
367+
"└─Object/child2 False NotAvailable",
368+
" │ second line",
369369
" └─Object/child2.1",
370370
},
371371
},
@@ -404,16 +404,16 @@ func Test_TreePrefix(t *testing.T) {
404404
return obectjTree
405405
}(),
406406
expectPrefix: []string{
407-
"Object/root Available: True Available",
408-
"├─Object/child1 Available: True Available",
409-
"│ └─Object/child2 Available: False NotAvailable",
410-
"│ │ second line",
411-
"│ └─Object/child3 Available: False NotAvailable",
412-
"│ │ second line",
413-
"│ └─Object/child4 Available: False NotAvailable",
414-
"│ second line",
415-
"└─Object/child5 Available: False NotAvailable",
416-
" second line",
407+
"Object/root True Available",
408+
"├─Object/child1 True Available",
409+
"│ └─Object/child2 False NotAvailable",
410+
"│ │ second line",
411+
"│ └─Object/child3 False NotAvailable",
412+
"│ │ second line",
413+
"│ └─Object/child4 False NotAvailable",
414+
"│ second line",
415+
"└─Object/child5 False NotAvailable",
416+
" second line",
417417
},
418418
},
419419
{
@@ -447,14 +447,14 @@ func Test_TreePrefix(t *testing.T) {
447447
return obectjTree
448448
}(),
449449
expectPrefix: []string{
450-
"Object/root Available: True Available",
451-
"└─Object/child1 Available: True Available",
452-
" └─Object/child2 Available: False NotAvailable",
453-
" │ second line",
454-
" └─Object/child3 Available: False NotAvailable",
455-
" │ second line",
456-
" └─Object/child4 Available: False NotAvailable",
457-
" second line",
450+
"Object/root True Available",
451+
"└─Object/child1 True Available",
452+
" └─Object/child2 False NotAvailable",
453+
" │ second line",
454+
" └─Object/child3 False NotAvailable",
455+
" │ second line",
456+
" └─Object/child4 False NotAvailable",
457+
" second line",
458458
},
459459
},
460460
{
@@ -493,16 +493,16 @@ func Test_TreePrefix(t *testing.T) {
493493
return obectjTree
494494
}(),
495495
expectPrefix: []string{
496-
"Object/root Available: True Available",
497-
"├─Object/child1 Available: True Available",
498-
"├─Object/child2 Available: False NotAvailable",
499-
"│ │ second line",
500-
"│ └─Object/child2.1 Available: False NotAvailable",
501-
"│ second line",
502-
"└─Object/child3 Available: False NotAvailable",
503-
" │ second line",
504-
" └─Object/child3.1 Available: False NotAvailable",
505-
" second line",
496+
"Object/root True Available",
497+
"├─Object/child1 True Available",
498+
"├─Object/child2 False NotAvailable",
499+
"│ │ second line",
500+
"│ └─Object/child2.1 False NotAvailable",
501+
"│ second line",
502+
"└─Object/child3 False NotAvailable",
503+
" │ second line",
504+
" └─Object/child3.1 False NotAvailable",
505+
" second line",
506506
},
507507
},
508508
}

0 commit comments

Comments
 (0)