Skip to content

Commit

Permalink
mgr/rook: Fix container id and image id in 'orch ps'
Browse files Browse the repository at this point in the history
Fixes: https://tracker.ceph.com/issues/47513
Signed-off-by: Varsha Rao <varao@redhat.com>
  • Loading branch information
varshar16 committed Nov 16, 2020
1 parent 040fc79 commit 1607bc5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pybind/mgr/rook/module.py
Expand Up @@ -374,7 +374,7 @@ def _list_daemons(self, service_name=None, daemon_type=None, daemon_id=None, hos
for p in pods:
sd = orchestrator.DaemonDescription()
sd.hostname = p['hostname']
sd.container_id = p['name']
sd.container_id = p['container_id'][0:12]
sd.daemon_type = p['labels']['app'].replace('rook-ceph-', '')
status = {
'Pending': -1,
Expand All @@ -397,6 +397,7 @@ def _list_daemons(self, service_name=None, daemon_type=None, daemon_id=None, hos
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']
Expand Down
2 changes: 2 additions & 0 deletions src/pybind/mgr/rook/rook_cluster.py
Expand Up @@ -335,6 +335,8 @@ def predicate(item):
"labels": d['metadata']['labels'],
'phase': d['status']['phase'],
'container_image_name': image_name,
'container_image_id': d['status']['container_statuses'][0]['image_id'].split('@sha256:')[1],
'container_id': d['status']['container_statuses'][0]['container_id'].split('docker://')[1],
'refreshed': refreshed,
# these may get set below...
'started': None,
Expand Down

0 comments on commit 1607bc5

Please sign in to comment.