mrk-andreev commented on code in PR #43853:
URL: https://github.com/apache/airflow/pull/43853#discussion_r1838981401
##########
providers/src/airflow/providers/cncf/kubernetes/utils/pod_manager.py:
##########
@@ -692,6 +737,12 @@ def read_pod_logs(
post_termination_timeout=post_termination_timeout,
)
+ @tenacity.retry(stop=tenacity.stop_after_attempt(3),
wait=tenacity.wait_exponential(), reraise=True)
+ def get_init_container_names(self, pod: V1Pod) -> list[str]:
+ """Return container names from the POD except for the
airflow-xcom-sidecar container."""
Review Comment:
This method mirror `get_container_names`:
```
@tenacity.retry(stop=tenacity.stop_after_attempt(3),
wait=tenacity.wait_exponential(), reraise=True)
def get_init_container_names(self, pod: V1Pod) -> list[str]:
"""Return container names from the POD except for the
airflow-xcom-sidecar container."""
pod_info = self.read_pod(pod)
return [container_spec.name for container_spec in
pod_info.spec.init_containers]
@tenacity.retry(stop=tenacity.stop_after_attempt(3),
wait=tenacity.wait_exponential(), reraise=True)
def get_container_names(self, pod: V1Pod) -> list[str]:
"""Return container names from the POD except for the
airflow-xcom-sidecar container."""
pod_info = self.read_pod(pod)
return [
container_spec.name
for container_spec in pod_info.spec.containers
if container_spec.name != PodDefaults.SIDECAR_CONTAINER_NAME
]
```
In this case `get_container_names` also will require same logic.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]