Fix merge issues with PR #2168 (#2288)

mine
Fernand Galiana 2023-11-12 10:59:09 -07:00 committed by GitHub
parent 5a8dc2d4b3
commit 7ece543681
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View File

@ -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
`

View File

@ -31,3 +31,4 @@ k9s:
view:
active: po
screenDumpDir: /tmp
disablePodCounting: false

View File

@ -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),