bdsoha commented on code in PR #27802:
URL: https://github.com/apache/airflow/pull/27802#discussion_r1027270810
##########
airflow/providers/cncf/kubernetes/utils/pod_manager.py:
##########
@@ -345,6 +356,17 @@ def read_pod_logs(
except BaseHTTPError:
self.log.exception("There was an error reading the kubernetes
API.")
raise
+
+ @tenacity.retry(stop=tenacity.stop_after_attempt(3),
wait=tenacity.wait_exponential(), reraise=True)
+ def get_container_names(self, pod: V1Pod):
+ """Read Container names from POD"""
+ container_names = []
+ pod_info = self.read_pod(pod)
+ for container_spec in pod_info.spec.containers:
+ if(container_spec.name != 'airflow-xcom-sidecar'):
Review Comment:
```suggestion
if(container_spec.name != "airflow-xcom-sidecar"):
```
##########
airflow/providers/cncf/kubernetes/utils/pod_manager.py:
##########
@@ -234,11 +234,12 @@ def consume_logs(*, since_time: DateTime | None = None,
follow: bool = True) ->
for raw_line in logs:
line = raw_line.decode("utf-8", errors="backslashreplace")
timestamp, message = self.parse_log_line(line)
- self.log.info(message)
+ self.log.info('[%s] %s', container_name, message)
Review Comment:
Use double quotes:
```suggestion
self.log.info("[%s] %s", container_name, message)
```
--
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]