5
votes

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
Did you find an answer? In helm, this should work: {{ "{{.WorkerID}}" }}, not sure about argo though but if it uses the same go template it might.Dan

1 Answers

3
votes

Using the {% raw %} tag:

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

Jinja2 Reference