Miretpl commented on code in PR #71349:
URL: https://github.com/apache/airflow/pull/71349#discussion_r4053827173
##########
providers/google/src/airflow/providers/google/cloud/hooks/kubernetes_engine.py:
##########
@@ -478,6 +482,27 @@ def apply_from_yaml_file(
)
+class _GKEAsyncApiClient(async_client.ApiClient):
+ """Retry a rejected GKE token once with refreshed credentials."""
+
+ def __init__(
+ self,
+ configuration: async_client.Configuration,
+ refresh_token: Callable[[], Awaitable[str | None]],
+ ) -> None:
+ super().__init__(configuration=configuration)
+ self._refresh_token = refresh_token
+
+ async def call_api(self, *args: Any, **kwargs: Any) -> Any:
+ try:
+ return await super().call_api(*args, **kwargs)
+ except async_client.ApiException as error:
+ if error.status != 401:
Review Comment:
We can receive a 401 code for more than just an expired token, so I don't
think that this handling is correct.
--
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]