Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor GKE hooks #38404

Merged
merged 1 commit into from
Mar 25, 2024
Merged

Refactor GKE hooks #38404

merged 1 commit into from
Mar 25, 2024

Conversation

moiseenkov
Copy link
Contributor

In order to reduce code duplication and high complexity of the implementation, GKE hooks were refactored in this PR:

  1. Existing GKEHook and GKEAsyncHook provide interface to GKE API remain unchanged.
  2. The new GKEKubernetesHook(GoogleBaseHook, KubernetesHook) was introduced as a replacement for redundant hooks that used to contain duplicated methods that now are simply inherited from GoogleBaseHook and KubernetesHook:
  • GKEDeploymentHook (deprecated)
  • GKECustomResourceHook (deprecated)
  • GKEPodHook (deprecated)
  • GKEJobHook (deprecated)
  1. By following the same pattern, the new GKEKubernetesAsyncHook(GoogleBaseAsyncHook, AsyncKubernetesHook) was introduced as a replacement for redundant hooks that used to contain duplicated methods that now are simply inherited from GoogleBaseAsyncHook and AsyncKubernetesHook:
  • GKEPodAsyncHook (deprecated)
  1. New hooks (GKEKubernetesHook, GKEKubernetesAsyncHook) provide access to the standard Kubernetes API with a GKE authentication.
  2. Slightly adjusted system tests (they are all green now).
    system tests
  3. Except tiny changes, unit tests remain the same in order to prove stability of the code after refactoring. In the following PR we will disconnect GKE operators from the deprecated hooks, so it will be easy to remove them in the future.

@boring-cyborg boring-cyborg bot added area:providers area:system-tests provider:cncf-kubernetes Kubernetes provider related issues provider:google Google (including GCP) related issues labels Mar 22, 2024
@VladaZakharova
Copy link
Contributor

Hi @potiuk ! Can you please take a look on this PR? This is a blocker for several other PRs for GKE :c

Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Not a complex one.

@potiuk potiuk merged commit 32ed83b into apache:main Mar 25, 2024
55 checks passed
utkarsharma2 pushed a commit to astronomer/airflow that referenced this pull request Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers area:system-tests provider:cncf-kubernetes Kubernetes provider related issues provider:google Google (including GCP) related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants