timofal opened a new issue #13348:
URL: https://github.com/apache/airflow/issues/13348


   Hello.
   
   Property `env_vars` or `KubernetesPodOperator` is not truly templated. 
Despite documentation and docstring claims it is.
   
   The reason is that class `V1EnvVar` from k8s official python client doesn't 
contain field `template_fields` that is required to render template fields. 
(See method `BaseOperator._render_nested_template_fields`.)
   
   The following workaround works for me.
   ```
   from kubernetes.client.models.v1_env_var import V1EnvVar
   
   if not hasattr(V1EnvVar, 'template_fields'):
       V1EnvVar.template_fields = ('value',)
   
   my_task = GKEStartPodOperator(task_id="my_task_id", ................... etc.
   ```
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to