amoghrajesh commented on code in PR #64242:
URL: https://github.com/apache/airflow/pull/64242#discussion_r2993187424
##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/hooks/kubernetes.py:
##########
@@ -1040,15 +1040,19 @@ async def read_logs(
# (e.g. binary data, truncated multi-byte sequences).
# kubernetes_asyncio's default decoding uses strict UTF-8 which
# crashes the task in those cases.
- raw_resp: ClientResponse = await
v1_api.read_namespaced_pod_log(
- name=name,
- namespace=namespace,
- container=container_name,
- follow=False,
- timestamps=True,
- since_seconds=since_seconds,
- _preload_content=False,
- ) # type: ignore # _preload_content=False makes returning
ClientResponse instead of str!
+ kwargs = {
+ "name": name,
+ "namespace": namespace,
+ "follow": False,
+ "timestamps": True,
+ "_preload_content": False,
+ }
+ if container_name is not None:
+ kwargs["container"] = container_name
+ if since_seconds is not None:
+ kwargs["since_seconds"] = since_seconds
+
+ raw_resp: ClientResponse = await
v1_api.read_namespaced_pod_log(**kwargs) # type: ignore #
_preload_content=False makes returning ClientResponse instead of str!
Review Comment:
Yes, its unrelated to this fix, see the comment `_preload_content=False
makes returning ClientResponse instead of str!`
--
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]