Skip to content

Commit

Permalink
Adding system arch to nodes view (derailed#2480)
Browse files Browse the repository at this point in the history
* adding arch to nodes view

* hiding arch under wide view and fix test

* fixing tests

---------

Co-authored-by: Andrei Maltsev <amaltsev@alpha-sense.com>
  • Loading branch information
2 people authored and thejoeejoee committed Feb 23, 2024
1 parent 317ab96 commit 3b25d91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions internal/render/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func (Node) Header(_ string) Header {
HeaderColumn{Name: "NAME"},
HeaderColumn{Name: "STATUS"},
HeaderColumn{Name: "ROLE"},
HeaderColumn{Name: "ARCH", Wide: true},
HeaderColumn{Name: "TAINTS"},
HeaderColumn{Name: "VERSION"},
HeaderColumn{Name: "KERNEL", Wide: true},
Expand Down Expand Up @@ -90,6 +91,7 @@ func (n Node) Render(o interface{}, ns string, r *Row) error {
no.Name,
join(statuses, ","),
join(roles, ","),
no.Status.NodeInfo.Architecture,
strconv.Itoa(len(no.Spec.Taints)),
no.Status.NodeInfo.KubeletVersion,
no.Status.NodeInfo.KernelVersion,
Expand Down
4 changes: 2 additions & 2 deletions internal/render/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ func TestNodeRender(t *testing.T) {
assert.Nil(t, err)

assert.Equal(t, "minikube", r.ID)
e := render.Fields{"minikube", "Ready", "master", "0", "v1.15.2", "4.15.0", "192.168.64.107", "<none>", "0", "10", "20", "0", "0", "4000", "7874"}
assert.Equal(t, e, r.Fields[:15])
e := render.Fields{"minikube", "Ready", "master", "amd64", "0", "v1.15.2", "4.15.0", "192.168.64.107", "<none>", "0", "10", "20", "0", "0", "4000", "7874"}
assert.Equal(t, e, r.Fields[:16])
}

func BenchmarkNodeRender(b *testing.B) {
Expand Down

0 comments on commit 3b25d91

Please sign in to comment.