Skip to content

Commit

Permalink
Merge pull request #11070 from red-hat-storage/revert-11068-cherry-pi…
Browse files Browse the repository at this point in the history
…ck-11047-to-release-4.16

Revert "[release-4.16] get_ceph_tools_pod - stop collecting and printing yaml's of all pods"
  • Loading branch information
petr-balogh authored Dec 19, 2024
2 parents dcc7669 + 43477e0 commit 5a8e605
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions ocs_ci/ocs/resources/pod.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,15 +805,16 @@ def _get_tools_pod_objs():
# one in status Terminated. Therefore, need to filter out the Terminated pod

# Update the OCP pod object without the selector
cmd = f"oc get pods -n {namespace} -o custom-columns=NAME:.metadata.name,STATUS:.status.phase --no-headers"
pods_output = exec_cmd(cmd, shell=True).stdout.decode()
pod_name_status_dict = {
line.split()[0]: line.split()[1] for line in pods_output.splitlines()
}

ocp_pod_obj = OCP(
kind=constants.POD,
namespace=namespace,
cluster_kubeconfig=cluster_kubeconfig,
)
running_ct_pods = list()
for pod in ct_pod_items:
pod_status = pod_name_status_dict.get(pod.get("metadata").get("name"))
pod_status = ocp_pod_obj.get_resource_status(
pod.get("metadata").get("name")
)
logger.info(f"Pod name: {pod.get('metadata').get('name')}")
logger.info(f"Pod status: {pod_status}")
if pod_status == constants.STATUS_RUNNING:
Expand Down

0 comments on commit 5a8e605

Please sign in to comment.