From: Varsha Rao Date: Thu, 12 Nov 2020 17:44:18 +0000 (+0530) Subject: mgr/rook: Fix image id in 'orch ps' X-Git-Tag: v16.1.0~351^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f84d5df5cf0cd53171bc161577ae70724a49f810;p=ceph.git mgr/rook: Fix image id in 'orch ps' Fixes: https://tracker.ceph.com/issues/47513 Signed-off-by: Varsha Rao --- diff --git a/src/pybind/mgr/rook/module.py b/src/pybind/mgr/rook/module.py index 1d6707237ab0..7cdca3f3f6be 100644 --- a/src/pybind/mgr/rook/module.py +++ b/src/pybind/mgr/rook/module.py @@ -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'] diff --git a/src/pybind/mgr/rook/rook_cluster.py b/src/pybind/mgr/rook/rook_cluster.py index a417d31e73d7..c842b3579cad 100644 --- a/src/pybind/mgr/rook/rook_cluster.py +++ b/src/pybind/mgr/rook/rook_cluster.py @@ -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,