Skip to content

Make cluster_context templated in KubernetesPodOperator #33604

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

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

mati-o
Copy link
Contributor

@mati-o mati-o commented Aug 22, 2023


Following Airflow's best practice guide for Variables, I have tried replacing all of my variables' usage in KubernetesPodOperator, such as image, config_file etc.. to use the templated syntax. However, for cluster_context this didn't work since it's not templated, as in the example below:

default_args = {
-   'cluster_context': Variable.get('k8s_cluster_name')
+   'cluster_context': '{{ var.value.k8s_cluster_name }}' 
}

I'd love to have this small feature incorporated, let me know of anything required beyond this commit

@boring-cyborg boring-cyborg bot added area:providers provider:cncf-kubernetes Kubernetes (k8s) provider related issues labels Aug 22, 2023
@hussein-awala hussein-awala changed the title Make cluster_context templated Make cluster_context templated in KubernetesPodOperator Aug 22, 2023
@hussein-awala hussein-awala merged commit 7141c42 into apache:main Aug 22, 2023
@mati-o mati-o deleted the make-cluster-context-templated branch August 22, 2023 15:20
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants