Skip to content

Commit

Permalink
Clean up issues introduced by derailed#2125 (derailed#2289)
Browse files Browse the repository at this point in the history
  • Loading branch information
derailed authored and thejoeejoee committed Jan 31, 2024
1 parent a847edd commit 685d792
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/model/table_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func TestTableHydrate(t *testing.T) {

assert.Nil(t, hydrate("blee", oo, rr, render.Pod{}))
assert.Equal(t, 1, len(rr))
assert.Equal(t, 23, len(rr[0].Fields))
assert.Equal(t, 22, len(rr[0].Fields))
}

func TestTableGenericHydrate(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions internal/render/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ func (Node) Header(_ string) Header {
func (n Node) Render(o interface{}, ns string, r *Row) error {
oo, ok := o.(*NodeWithMetrics)
if !ok {
return fmt.Errorf("Expected *NodeAndMetrics, but got %T", o)
return fmt.Errorf("expected *NodeAndMetrics, but got %T", o)
}
meta, ok := oo.Raw.Object["metadata"].(map[string]interface{})
if !ok {
return fmt.Errorf("Unable to extract meta")
return fmt.Errorf("unable to extract meta")
}
na := extractMetaField(meta, "name")
var no v1.Node
Expand Down
1 change: 0 additions & 1 deletion internal/render/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ func (p Pod) Render(o interface{}, ns string, row *Row) error {
po.ObjectMeta.Name,
"●",
strconv.Itoa(cr) + "/" + strconv.Itoa(len(po.Spec.Containers)),
strconv.Itoa(rc),
phase,
strconv.Itoa(rc),
na(po.Status.PodIP),
Expand Down
4 changes: 2 additions & 2 deletions internal/render/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func TestPodRender(t *testing.T) {
assert.Nil(t, err)

assert.Equal(t, "default/nginx", r.ID)
e := render.Fields{"default", "nginx", "●", "1/1", "0", "Running", "0", "172.17.0.6", "minikube", "<none>", "<none>", "100", "50", "100:0", "70:170", "100", "n/a"}
e := render.Fields{"default", "nginx", "●", "1/1", "Running", "0", "172.17.0.6", "minikube", "<none>", "<none>", "100", "50", "100:0", "70:170", "100", "n/a", "71"}
assert.Equal(t, e, r.Fields[:17])
}

Expand Down Expand Up @@ -190,7 +190,7 @@ func TestPodInitRender(t *testing.T) {
assert.Nil(t, err)

assert.Equal(t, "default/nginx", r.ID)
e := render.Fields{"default", "nginx", "●", "1/1", "0", "Init:0/1", "0", "172.17.0.6", "minikube", "<none>", "<none>", "10", "10", "100:0", "70:170", "10", "n/a"}
e := render.Fields{"default", "nginx", "●", "1/1", "Init:0/1", "0", "172.17.0.6", "minikube", "<none>", "<none>", "10", "10", "100:0", "70:170", "10", "n/a", "14"}
assert.Equal(t, e, r.Fields[:17])
}

Expand Down

0 comments on commit 685d792

Please sign in to comment.