Skip to content

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