]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/rook: Fix image id in 'orch ps'
authorVarsha Rao <varao@redhat.com>
Thu, 12 Nov 2020 17:44:18 +0000 (23:14 +0530)
committerVarsha Rao <varao@redhat.com>
Fri, 27 Nov 2020 08:52:09 +0000 (14:22 +0530)
Fixes: https://tracker.ceph.com/issues/47513
Signed-off-by: Varsha Rao <varao@redhat.com>
src/pybind/mgr/rook/module.py
src/pybind/mgr/rook/rook_cluster.py

index 1d6707237ab07161118cdc19f4a9fcc6ae98b14c..7cdca3f3f6bef49ec3a134b58bcdfe2a7a7ebb62 100644 (file)
@@ -397,6 +397,7 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator):
             if service_name is not None and service_name != sd.service_name():
                 continue
             sd.container_image_name = p['container_image_name']
+            sd.container_image_id = p['container_image_id']
             sd.created = p['created']
             sd.last_configured = p['created']
             sd.last_deployed = p['created']
index a417d31e73d71cacfdc534002a49a0f4ab19ef25..c842b3579cadabcb05f67d449645a2cce2189cec 100644 (file)
@@ -319,6 +319,7 @@ class RookCluster(object):
         pods = [i for i in self.rook_pods.items if predicate(i)]
 
         pods_summary = []
+        prefix = 'sha256:'
 
         for p in pods:
             d = p.to_dict()
@@ -329,12 +330,16 @@ class RookCluster(object):
                 image_name = c['image']
                 break
 
+            image_id = d['status']['container_statuses'][0]['image_id']
+            image_id = image_id.split(prefix)[1] if prefix in image_id else image_id
+
             s = {
                 "name": d['metadata']['name'],
                 "hostname": d['spec']['node_name'],
                 "labels": d['metadata']['labels'],
                 'phase': d['status']['phase'],
                 'container_image_name': image_name,
+                'container_image_id': image_id,
                 'refreshed': refreshed,
                 # these may get set below...
                 'started': None,