diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 9530a353..ee171011 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -375,6 +375,7 @@ var expectedConfig = `k9s: critical: 90 warn: 70 screenDumpDir: /tmp + disablePodCounting: false ` var resetConfig = `k9s: @@ -428,4 +429,5 @@ var resetConfig = `k9s: critical: 90 warn: 70 screenDumpDir: /tmp + disablePodCounting: false ` diff --git a/internal/config/testdata/k9s.yml b/internal/config/testdata/k9s.yml index b9116b27..e98a2180 100644 --- a/internal/config/testdata/k9s.yml +++ b/internal/config/testdata/k9s.yml @@ -31,3 +31,4 @@ k9s: view: active: po screenDumpDir: /tmp + disablePodCounting: false diff --git a/internal/render/node.go b/internal/render/node.go index b5331a6f..11e6d398 100644 --- a/internal/render/node.go +++ b/internal/render/node.go @@ -77,6 +77,10 @@ func (n Node) Render(o interface{}, ns string, r *Row) error { nodeRoles(&no, roles) sort.Sort(roles) + podCount := strconv.Itoa(oo.PodCount) + if pc := oo.PodCount; pc == -1 { + podCount = NAValue + } r.ID = client.FQN("", na) r.Fields = Fields{ no.Name, @@ -86,7 +90,7 @@ func (n Node) Render(o interface{}, ns string, r *Row) error { no.Status.NodeInfo.KernelVersion, iIP, eIP, - strconv.Itoa(oo.PodCount), + podCount, toMc(c.cpu), toMi(c.mem), client.ToPercentageStr(c.cpu, a.cpu),