fix broken tests

mine
derailed 2019-01-25 17:53:23 -07:00
parent 04544efc1b
commit 3e210f0fe5
4 changed files with 21 additions and 17 deletions

View File

@ -33,11 +33,11 @@ func TestToPorts(t *testing.T) {
}{ }{
{[]v1.ServicePort{ {[]v1.ServicePort{
v1.ServicePort{Name: "http", Port: 80, NodePort: 90, Protocol: "TCP"}}, v1.ServicePort{Name: "http", Port: 80, NodePort: 90, Protocol: "TCP"}},
"http:8090/TCP", "http:80->90/TCP",
}, },
{[]v1.ServicePort{ {[]v1.ServicePort{
v1.ServicePort{Port: 80, NodePort: 30080, Protocol: "UDP"}}, v1.ServicePort{Port: 80, NodePort: 30080, Protocol: "UDP"}},
"8030080/UDP", "80->30080/UDP",
}, },
} }
for _, u := range uu { for _, u := range uu {

View File

@ -44,7 +44,8 @@ func TestSvcFields(t *testing.T) {
"ClusterIP", "ClusterIP",
"1.1.1.1", "1.1.1.1",
"2.2.2.2", "2.2.2.2",
"http:90➔ 0/TCP", "fred=blee",
"http:90->0/TCP",
}, },
}, },
} }
@ -88,7 +89,7 @@ func TestSVCListData(t *testing.T) {
assert.Equal(t, "blee", l.GetNamespace()) assert.Equal(t, "blee", l.GetNamespace())
assert.False(t, l.HasXRay()) assert.False(t, l.HasXRay())
row := td.Rows["blee/fred"] row := td.Rows["blee/fred"]
assert.Equal(t, 6, len(row.Deltas)) assert.Equal(t, 7, len(row.Deltas))
for _, d := range row.Deltas { for _, d := range row.Deltas {
assert.Equal(t, "", d) assert.Equal(t, "", d)
} }
@ -143,6 +144,7 @@ func svcHeader() resource.Row {
"TYPE", "TYPE",
"CLUSTER-IP", "CLUSTER-IP",
"EXTERNAL-IP", "EXTERNAL-IP",
"SELECTOR",
"PORT(S)", "PORT(S)",
"AGE", "AGE",
} }

View File

@ -23,13 +23,15 @@ func newPodView(t string, app *appView, list resource.List, c colorerFn) resourc
v.AddPage("logs", logs, true, false) v.AddPage("logs", logs, true, false)
picker := newSelectList() picker := newSelectList()
picker.SetSelectedFunc(func(i int, t, d string, r rune) { {
log.Println("Selected", i, t, d, r) picker.SetSelectedFunc(func(i int, t, d string, r rune) {
v.sshInto(v.selectedItem, t) log.Println("Selected", i, t, d, r)
}) v.sshInto(v.selectedItem, t)
picker.setActions(keyActions{ })
tcell.KeyCtrlB: {description: "Back", action: v.back}, picker.setActions(keyActions{
}) tcell.KeyCtrlB: {description: "Back", action: v.back},
})
}
v.AddPage("choose", picker, true, false) v.AddPage("choose", picker, true, false)
v.switchPage("po") v.switchPage("po")

View File

@ -14,12 +14,12 @@ const (
) )
var logo = []string{ var logo = []string{
` ____ __.________ `, ` __ ______ `,
`| |/ _/ __ \______`, `| | __/ __ \ ______`,
`| < \____ / ___/`, `| |/ /> < / ___/`,
`| | \ / /\___ \ `, `| </ -- \\___ \ `,
`|____|__ \ /____//____ >`, `|__|_ \______ /____ >`,
` \/ \/`, ` \/ \/ \/ `,
} }
var co = []string{ var co = []string{