How to properly escape brackets in ArgoCD?



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



  • 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


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2