Skip to content

Make cluster_context templated in KubernetesPodOperator - #33604

Merged
hussein-awala merged 1 commit into
apache:mainfrom
mati-o:make-cluster-context-templated
Aug 22, 2023
Merged

Make cluster_context templated in KubernetesPodOperator#33604
hussein-awala merged 1 commit into
apache:mainfrom
mati-o:make-cluster-context-templated

Conversation

@mati-o

@mati-omati-o commented Aug 22, 2023

Copy link
Copy Markdown
Contributor

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-cyborgboring-cyborgBot added area:providers provider:cncf-kubernetes Kubernetes (k8s) provider related issues labels Aug 22, 2023
@hussein-awalahussein-awala changed the title Make cluster_context templatedMake cluster_context templated in KubernetesPodOperatorAug 22, 2023
@hussein-awala
hussein-awala merged commit 7141c42 into apache:mainAug 22, 2023
@mati-o
mati-o deleted the make-cluster-context-templated branch August 22, 2023 15:20
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providersprovider:cncf-kubernetesKubernetes (k8s) provider related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@mati-o@Taragolis@hussein-awala