You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/06/10 16:20:16 UTC

[GitHub] [airflow] DMilmont commented on issue #24197: KubernetesPodOperator rendered template tab does not prettty print `env_vars`

DMilmont commented on issue #24197:
URL: https://github.com/apache/airflow/issues/24197#issuecomment-1152529215

   I took a crack at this but I don't think it is easily possible to make the env_vars formatting nicer. I tried adding this line to the k8s pod operator ```    template_fields_renderers = {"env_vars": "json"}```
   
   The env_vars look like this in the UI afterwards: 
   <img width="668" alt="image" src="https://user-images.githubusercontent.com/3598125/173108728-db7dbcd6-0abd-4385-a4ff-39979e48f1c9.png">
   
   In the past it looks like env_vars was just a dict so it was easy to format it with the json lexer however now env_vars are converted to a list of env_vars with [this function](https://github.com/apache/airflow/blob/2b2d97068fa45881672dab6f2134becae246f3f3/airflow/providers/cncf/kubernetes/backcompat/backwards_compat_converters.py#L90-L105).
   
   Perhaps there is a way to still make this work, but it isn't as straight forward as I was hoping. 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org