]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/rook/rook_cluster: ignore pods with no containers
authorSage Weil <sage@newdream.net>
Thu, 4 Nov 2021 14:50:13 +0000 (09:50 -0500)
committerSage Weil <sage@newdream.net>
Mon, 8 Nov 2021 19:30:16 +0000 (13:30 -0600)
Signed-off-by: Sage Weil <sage@newdream.net>
src/pybind/mgr/rook/rook_cluster.py

index 48e8bc95d240a7df749ac18c5044c4d946dafc50..bc29b3098683071ec9b3057c9d947e106560062b 100644 (file)
@@ -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 = {