]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/rook: include container_image_name in 'orch ps'
authorSage Weil <sage@redhat.com>
Tue, 10 Mar 2020 22:53:09 +0000 (18:53 -0400)
committerSage Weil <sage@redhat.com>
Thu, 12 Mar 2020 21:10:35 +0000 (17:10 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/rook/module.py
src/pybind/mgr/rook/rook_cluster.py

index 93e9ef4dc7dfdc6f02c66e38f8e1bb4ce4c06ae0..2bfb0ed5f500d19eddaaef1e628448c849fd110a 100644 (file)
@@ -286,6 +286,7 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator):
                 # Unknown type -- skip it
                 continue
 
+            sd.container_image_name = p['container_image_name']
             result.append(sd)
 
         return result
index 6a8de2a9b312affe9d2811fb3635dd3c02a85875..4d6828b3f300b9e6a8dfccadd810a034a21a3779 100644 (file)
@@ -320,11 +320,19 @@ class RookCluster(object):
         for p in pods:
             d = p.to_dict()
             # p['metadata']['creationTimestamp']
+
+            image_name = None
+            for c in d['spec']['containers']:
+                # look at the first listed container in the pod...
+                image_name = c['image']
+                break
+
             pods_summary.append({
                 "name": d['metadata']['name'],
                 "hostname": d['spec']['node_name'],
                 "labels": d['metadata']['labels'],
-                'phase': d['status']['phase']
+                'phase': d['status']['phase'],
+                'container_image_name': image_name,
             })
 
         return pods_summary