argocd-image-updater icon indicating copy to clipboard operation
argocd-image-updater copied to clipboard

fix(update-methods.md):add escaping to the template so helm doesn't consume it

Open galamdring opened this issue 1 year ago • 1 comments

If the {{ and }} are not escaped, Helm will consume those, and the whole template will be lost.

The original example:

argocd-image-updater.argoproj.io/git-branch: main:image-updater{{range .Images}}-{{.Name}}-{{.NewTag}}{{end}}

will render as image-updater because the whole template is lost. The fix to this is to escape the {{ and }} like so:

argocd-image-updater.argoproj.io/git-branch: main:image-updater{{"{{"}}range .Images{{"}}"}}-{{"{{"}}.Name{{"}}"}}-{{"{{"}}.NewTag{{"}}"}}{{"{{"}}end{{"}}"}}

galamdring avatar Oct 15 '24 15:10 galamdring

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 75.95%. Comparing base (02eee1d) to head (f1976ce).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #888   +/-   ##
=======================================
  Coverage   75.95%   75.95%           
=======================================
  Files          31       31           
  Lines        3198     3198           
=======================================
  Hits         2429     2429           
  Misses        635      635           
  Partials      134      134           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Oct 15 '24 15:10 codecov-commenter