Skip to content

Conversation

@galamdring
Copy link

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{{"}}"}}
@codecov-commenter
Copy link

codecov-commenter commented Oct 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Luke McKechnie <galamdring@gmail.com>
@galamdring galamdring force-pushed the galamdring/docs/fix-template-example branch from c7631ed to f1976ce Compare October 15, 2024 15:52
```yaml
argocd-image-updater.argoproj.io/git-branch: main:image-updater{{range .Images}}-{{.Name}}-{{.NewTag}}{{end}}
argocd-image-updater.argoproj.io/git-branch: main:image-updater{{"{{"}}range .Images{{"}}"}}-{{"{{"}}.Name{{"}}"}}-{{"{{"}}.NewTag{{"}}"}}{{"{{"}}end{{"}}"}}
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to keep the original form for non-helm cases, and also for easy viewing of the real value? We can add the helm-escaped form for helm cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants