You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "VladaZakharova (via GitHub)" <gi...@apache.org> on 2023/02/01 12:35:52 UTC

[GitHub] [airflow] VladaZakharova commented on a diff in pull request #29266: Add deferrable mode to GKEStartPodOperator

VladaZakharova commented on code in PR #29266:
URL: https://github.com/apache/airflow/pull/29266#discussion_r1093161447


##########
airflow/providers/google/cloud/hooks/kubernetes_engine.py:
##########
@@ -25,29 +25,44 @@
 """
 from __future__ import annotations
 
+import contextlib
 import json
 import time
 import warnings
 from typing import Sequence
 
+import google.auth.credentials
+from gcloud.aio.auth import Token
 from google.api_core.exceptions import AlreadyExists, NotFound
 from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
 from google.api_core.retry import Retry
+from google.auth.transport import requests as google_requests
 
 # not sure why but mypy complains on missing `container_v1` but it is clearly there and is importable
 from google.cloud import container_v1, exceptions  # type: ignore[attr-defined]
 from google.cloud.container_v1 import ClusterManagerClient
 from google.cloud.container_v1.types import Cluster, Operation
+from kubernetes import client
+from kubernetes_asyncio import client as async_client
+from kubernetes_asyncio.client.models import V1Pod
+from kubernetes_asyncio.config.kube_config import FileOrData
+from urllib3.exceptions import HTTPError
 
 from airflow import version
+from airflow.compat.functools import cached_property
 from airflow.exceptions import AirflowException
+from airflow.kubernetes.pod_generator_deprecated import PodDefaults
 from airflow.providers.google.common.consts import CLIENT_INFO
-from airflow.providers.google.common.hooks.base_google import PROVIDE_PROJECT_ID, GoogleBaseHook
+from airflow.providers.google.common.hooks.base_google import (
+    PROVIDE_PROJECT_ID,
+    GoogleBaseAsyncHook,
+    GoogleBaseHook,
+)
 
 OPERATIONAL_POLL_INTERVAL = 15
 
 
-class GKEHook(GoogleBaseHook):
+class GKEClusterHook(GoogleBaseHook):

Review Comment:
   Sure, good idea!
   The name was changed to suite hooks' purpose: there are 2 different classes for separate hooks for cluster and pod management. I will revert the name change and leave a descriptive comment below. 



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org