Use DefaultColorer for aliases rendering

mine
tlipinski 2020-10-03 14:03:04 +02:00
parent 9406d0821d
commit e0921d8348
2 changed files with 4 additions and 7 deletions

View File

@ -5,7 +5,6 @@ import (
"strings"
"github.com/derailed/k9s/internal/client"
"github.com/gdamore/tcell"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
@ -15,9 +14,7 @@ type Alias struct{}
// ColorerFunc colors a resource row.
func (Alias) ColorerFunc() ColorerFunc {
return func(ns string, _ Header, re RowEvent) tcell.Color {
return tcell.ColorAliceBlue
}
return DefaultColorer
}
// Header returns a header row.

View File

@ -25,15 +25,15 @@ func TestAliasColorer(t *testing.T) {
"addAll": {
ns: client.AllNamespaces,
re: render.RowEvent{Kind: render.EventAdd, Row: r},
e: tcell.ColorAliceBlue},
e: tcell.ColorBlack},
"deleteAll": {
ns: client.AllNamespaces,
re: render.RowEvent{Kind: render.EventDelete, Row: r},
e: tcell.ColorAliceBlue},
e: tcell.ColorBlack},
"updateAll": {
ns: client.AllNamespaces,
re: render.RowEvent{Kind: render.EventUpdate, Row: r},
e: tcell.ColorAliceBlue,
e: tcell.ColorBlack,
},
}