Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-4.17] get_ceph_tools_pod - stop collecting and printing yaml's of all pods #11067

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions ocs_ci/ocs/resources/pod.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,16 +851,15 @@ 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
ocp_pod_obj = OCP(
kind=constants.POD,
namespace=namespace,
cluster_kubeconfig=cluster_kubeconfig,
)
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()
}

running_ct_pods = list()
for pod in ct_pod_items:
pod_status = ocp_pod_obj.get_resource_status(
pod.get("metadata").get("name")
)
pod_status = pod_name_status_dict.get(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
Loading