m1racoli commented on code in PR #37486:
URL: https://github.com/apache/airflow/pull/37486#discussion_r1494303880
##########
airflow/providers/google/cloud/hooks/kubernetes_engine.py:
##########
@@ -709,37 +709,34 @@ async def get_pod(self, name: str, namespace: str) ->
V1Pod:
:param name: Name of the pod.
:param namespace: Name of the pod's namespace.
"""
- with await self.service_file_as_context() as service_file: # type:
ignore[attr-defined]
- async with Token(scopes=self.scopes, service_file=service_file) as
token:
- async with self.get_conn(token) as connection:
- v1_api = async_client.CoreV1Api(connection)
- pod: V1Pod = await v1_api.read_namespaced_pod(
- name=name,
- namespace=namespace,
- )
- return pod
+ token = await self.get_token()
Review Comment:
Yes, we use
[hook.get_credentials_and_project_id()](https://github.com/apache/airflow/blob/fa234e0d229dfebb6284dd851870e64186fb53e2/airflow/providers/google/common/hooks/base_google.py#L661C37-L661C67)
to generate credentials used in `_CredentialsToken`. This method respects what
is configured in the GCP connection and thus also supports keyfile path and
keyfile dict or `GOOGLE_APPLICATION_CREDENTIALS`.
--
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]