Skip to content

fix(providers-google): gcp_conn_id parameter ignored in GKEStartPodOperator hook property - #34194

Merged
potiuk merged 1 commit into
apache:mainfrom
mikaeld:fix/gcp-conn-id
Sep 11, 2023
Merged

fix(providers-google): gcp_conn_id parameter ignored in GKEStartPodOperator hook property#34194
potiuk merged 1 commit into
apache:mainfrom
mikaeld:fix/gcp-conn-id

Conversation

@mikaeld

@mikaeld mikaeld commented Sep 7, 2023

Copy link
Copy Markdown
Contributor

This fixes an issue introduced in "Add deferrable mode to GKEStartPodOperator" (#29266). gcp_conn_id is not passed as parameter during the GKEPodHook instanciation in GKEStartPodOperator.hook. This results in the gcp_conn_id being ignored and replaced by the default value google_cloud_default as can be seen in the following logs.

[2023-09-07, 19:14:32 UTC] {base.py:73} INFO - Using connection ID 'google_cloud_airflow_gke' for task execution.
[2023-09-07, 19:14:32 UTC] {kubernetes_engine.py:288} INFO - Fetching cluster (project_id=<redacted>, location=<redacted>, cluster_name=<redacted>)
[2023-09-07, 19:14:32 UTC] {pod.py:852} INFO - Building pod gke-pod-12asd34v with labels: {'dag_id': '<redacted>', 'task_id': '<redacted>', 'run_id': 'manual__2023-09-07T190347.0421980000-2fafa4fb6', 'kubernetes_pod_operator': 'True', 'try_number': '3'}
[2023-09-07, 19:14:32 UTC] {pod.py:907} ERROR - The conn_id `google_cloud_default` isn't defined

This PR also adds unit tests to validate usage of gcp_conn_id


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@boring-cyborg boring-cyborg Bot added area:providers provider:cncf-kubernetes Kubernetes (k8s) provider related issues provider:google Google (including GCP) related issues labels Sep 7, 2023
@potiuk
potiuk merged commit db38a6f into apache:main Sep 11, 2023
@mikaeld
mikaeld deleted the fix/gcp-conn-id branch September 11, 2023 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:cncf-kubernetes Kubernetes (k8s) provider related issues provider:google Google (including GCP) related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants