How to escape “{{” and “}}” in argo workflow

情到浓时终转凉″ 提交于 2020-12-05 19:55:08

问题


I want to run one argo workflow in which a value is surrounded with double braces. Argo tries to resolve it but I don't want argo to resolve it.

Following is a fraction of katib studyjob workflow manifest.

workerSpec: 
  goTemplate: 
    rawTemplate: |-
        apiVersion: "kubeflow.org/v1beta1"
        kind: TFJob
        metadata:
          name: {{.WorkerID}}
          namespace: kubeflow

Here argo tries to resolve {{.WorkerID}}. But I don't want argo to resolve it.

How can I do this? How can I escape "{{" and "}}"?


回答1:


Using the {% raw %} tag:

{% raw %} {{.WorkerID}} {% endraw %}

Jinja2 Reference



来源:https://stackoverflow.com/questions/56341558/how-to-escape-and-in-argo-workflow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!