mik-laj commented on a change in pull request #10023:
URL: https://github.com/apache/airflow/pull/10023#discussion_r471716895
##########
File path: airflow/providers/cncf/kubernetes/hooks/kubernetes.py
##########
@@ -99,19 +97,76 @@ def create_custom_resource_definition(self,
version=version,
namespace=namespace,
plural=plural,
- body=body
+ body=body,
)
self.log.debug("Response: %s", response)
return response
except client.rest.ApiException as e:
- raise AirflowException("Exception when calling ->
create_custom_resource_definition: %s\n" % e)
-
- def get_custom_resource_definition(self,
- group: str,
- version: str,
- plural: str,
- name: str,
- namespace: Optional[str] = None):
+ raise AirflowException(
+ "Exception when calling -> create_custom_resource_definition:
%s\n" % e
+ )
+
+ def get_pod_log_stream(
+ self,
+ pod_name: str,
+ container: Optional[str] = "",
+ namespace: Optional[str] = None,
+ ) -> Tuple[watch.Watch, Generator[str, None, None]]:
+ """
+ Retrieves a log stream for a container in a kubernetes pod.
+
+ :param pod_name: pod name
+ :type pod_name: str
+ :param container: container name
+ :type version: str
+ :param namespace: kubernetes namespace
+ :type namespace: str
+ """
+
+ api = client.CoreV1Api(self.get_conn())
+ watcher = watch.Watch()
+ return (
+ watcher,
+ watcher.stream(
Review comment:
https://github.com/apache/airflow/pull/9570
Does this problem occur here? What permissions are needed for this method?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]