Skip to content

Commit 9b5e12e

Browse files
committed
show pending pod count even if no nodes are present
1 parent 230fe4d commit 9b5e12e

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

pkg/model/uimodel.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,6 @@ func (u *UIModel) View() string {
7777
b := strings.Builder{}
7878

7979
stats := u.cluster.Stats()
80-
if stats.NumNodes == 0 {
81-
fmt.Fprintln(&b, "Waiting for update or no nodes found...")
82-
fmt.Fprintln(&b, u.paginator.View())
83-
fmt.Fprintln(&b, helpStyle("←/→ page • q: quit"))
84-
85-
return b.String()
86-
}
8780

8881
ctw := text.NewColorTabWriter(&b, 0, 8, 1)
8982
u.writeClusterSummary(u.cluster.resources, stats, ctw)
@@ -93,6 +86,14 @@ func (u *UIModel) View() string {
9386
fmt.Fprintf(&b, "%d pods (%d pending %d running %d bound)\n", stats.TotalPods,
9487
stats.PodsByPhase[v1.PodPending], stats.PodsByPhase[v1.PodRunning], stats.BoundPodCount)
9588

89+
if stats.NumNodes == 0 {
90+
fmt.Fprintln(&b)
91+
fmt.Fprintln(&b, "Waiting for update or no nodes found...")
92+
fmt.Fprintln(&b, u.paginator.View())
93+
fmt.Fprintln(&b, helpStyle("←/→ page • q: quit"))
94+
return b.String()
95+
}
96+
9697
fmt.Fprintln(&b)
9798
u.paginator.PerPage = u.computeItemsPerPage(stats.Nodes, &b)
9899
u.paginator.SetTotalPages(stats.NumNodes)

0 commit comments

Comments
 (0)