Skip to content

Commit 7c906d4

Browse files
author
Moshe Avni
authored
chore/pod-container-count (#415)
1 parent 39f7cc0 commit 7c906d4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lua/kubectl/views/pods/definition.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ local M = {
1717

1818
local function getReady(row)
1919
local status = { symbol = "", value = "", sort_by = 0 }
20-
local readyCount = 0
2120
local containers = 0
21+
if row.spec and row.spec.containers then
22+
containers = #row.spec.containers
23+
end
24+
local readyCount = 0
2225
if row.status and row.status.containerStatuses then
2326
for _, value in ipairs(row.status.containerStatuses) do
24-
containers = containers + 1
2527
if value.ready then
2628
readyCount = readyCount + 1
2729
end

0 commit comments

Comments
 (0)