From 473a8e04f5e2486a37c307c246344b1c04907877 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 4 Nov 2021 09:50:13 -0500 Subject: [PATCH] mgr/rook/rook_cluster: ignore pods with no containers Signed-off-by: Sage Weil --- src/pybind/mgr/rook/rook_cluster.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/rook/rook_cluster.py b/src/pybind/mgr/rook/rook_cluster.py index 48e8bc95d24..bc29b309868 100644 --- a/src/pybind/mgr/rook/rook_cluster.py +++ b/src/pybind/mgr/rook/rook_cluster.py @@ -802,7 +802,11 @@ class RookCluster(object): image_name = c['image'] break - image_id = d['status']['container_statuses'][0]['image_id'] + ls = d['status'].get('container_statuses') + if not ls: + # ignore pods with no containers + continue + image_id = ls[0]['image_id'] image_id = image_id.split(prefix)[1] if prefix in image_id else image_id s = { -- 2.39.5