From f84d5df5cf0cd53171bc161577ae70724a49f810 Mon Sep 17 00:00:00 2001 From: Varsha Rao Date: Thu, 12 Nov 2020 23:14:18 +0530 Subject: [PATCH] mgr/rook: Fix image id in 'orch ps' Fixes: https://tracker.ceph.com/issues/47513 Signed-off-by: Varsha Rao --- src/pybind/mgr/rook/module.py | 1 + src/pybind/mgr/rook/rook_cluster.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/pybind/mgr/rook/module.py b/src/pybind/mgr/rook/module.py index 1d6707237ab..7cdca3f3f6b 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 a417d31e73d..c842b3579ca 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, -- 2.47.3