问题
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