Answers: <p>Try this &quot;beauty&quot;:</p>
  <pre><code>{{ &quot;'{{steps.scheduler.outputs.result}} =~ example'&quot; }}
  </code></pre>
  <ul>
  <li>{{ &quot;&quot; }} - instructs go template to consider anything within as a literal</li>
  <li>' - is a faint attempt to keep it as a string value in YAML; it should be optional</li>
  </ul>
  
Answers: CC BY-SA 4.0
Answers: 2022-11-18T03:36:35.500Z
Answers: 2022-11-18T03:36:35.500Z
Answers: Grigorash Vasilij
Body: <p>I have an ArgoCD + Argo Workfows setup. In my manifests files, I am trying to escape double brackets since I have some helm apps,  and if I manually edit the Argo workflow file with the expression below, it works. BUT if I push any changes my app gets degraded, with the following error: <code>cannot validate Workflow: templates.main.steps failed to resolve {{steps.scheduler.outputs.result}}</code> and this is what my config looks like:</p>
  <pre><code>    templates:
        - name: main
          steps:
          - - name: scheduler
              template: scheduler
            - name: step-1
              templateRef:
                name: step-1
                template: my-templates
              when: '&quot;{{`{{steps.scheduler.outputs.result}}`}}&quot; =~ example'
  </code></pre>
  <p>Any ideas? I think this might be Argocd related, since the error only appears there and I can manually run the workflow from Argo.</p>
  
Tags: <kubernetes><helm><yaml>
Title: How to properly escape brackets in ArgoCD?
UserDisplayName: Abe
ThreadText: # How to properly escape brackets in ArgoCD?
  
  (Asked by: username_0 on 2022-08-02)
  
  I have an ArgoCD + Argo Workfows setup. In my manifests files, I am trying to escape double brackets since I have some helm apps, and if I manually edit the Argo workflow file with the expression below, it works. BUT if I push any changes my app gets degraded, with the following error: `cannot validate Workflow: templates.main.steps failed to resolve {{steps.scheduler.outputs.result}}` and this is what my config looks like:
  
  ```
      templates:
        - name: main
          steps:
          - - name: scheduler
              template: scheduler
            - name: step-1
              templateRef:
                name: step-1
                template: my-templates
              when: '"{{`{{steps.scheduler.outputs.result}}`}}" =~ example'
  
  ```
  
  Any ideas? I think this might be Argocd related, since the error only appears there and I can manually run the workflow from Argo.
  
  **Tags:** kubernetes, helm, yaml
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-11-18. Score: 2
  
  Try this "beauty":
  
  ```
  {{ "'{{steps.scheduler.outputs.result}} =~ example'" }}
  
  ```
  
  * {{ "" }} - instructs go template to consider anything within as a literal
  * ' - is a faint attempt to keep it as a string value in YAML; it should be optional
  
  
  ---
  
  