in src/neper_healthcheck/neper_runner.py [0:0]
def get_host_name(pod_name: str) -> str:
"""Retrieve the host name where the specified pod is running.
Args:
pod_name (str): The name of the pod for which the host name is to be
retrieved.
Returns:
str: The host name where the pod is running.
"""
start_time = time.time()
while timeout_check(start_time, pod_name):
result = checker_common.run_command(
f"ssh {pod_name} -p 222 -- cat /host.name",
check=False,
)
if result.returncode == 0:
return result.stdout
time.sleep(1)
return ""