MaksYermak commented on code in PR #23773:
URL: https://github.com/apache/airflow/pull/23773#discussion_r888715360
##########
airflow/providers/google/cloud/utils/credentials_provider.py:
##########
@@ -248,6 +250,16 @@ def get_credentials_and_project(self) ->
Tuple[google.auth.credentials.Credentia
project_id =
_get_project_id_from_service_account_email(self.target_principal)
+ if isinstance(credentials, compute_engine.Credentials):
+ try:
+ credentials.refresh(_http_client.Request())
+ except RefreshError as msg:
+ """
+ If the Compute Engine metadata service can't be reached in
this case the instance has not
+ credentials.
+ """
+ self._log_debug(msg)
Review Comment:
@potiuk after discussion with @kosteev we have decided to move this refresh
method to `_get_credentials_email` in `base_google` hook.
--
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]