hashicorp / hashicorp/nomad

Add delimiter escape info in Documentation

Open
#14,820 1 comment 0 reactions 0 assignees View on GitHub
stage/accepted theme/docs theme/website type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Proposal
Add delimiter escape info in Documentation.

In template I have an env like this:
`URL = http://1.1.1.1:1111/clients/{{ID}}`
where {{ID}} is later being replaced in Go templates, but during deploying I get the following error
`Template failed: (dynamic): parse: template: :12: function "ID" not defined`
I've searched info in https://www.nomadproject.io/docs/job-specification/hcl2/expressions and https://www.nomadproject.io/docs/job-specification/template but couldn't find.

After many trials next option worked
`URL = http://1.1.1.1:1111/clients/{{"{{ID}}"}}`

It looks like a common solution for nomad seniors, but not for novices like me. My proposal is to add this case in documentation. Thank you

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Nomad documentation pages for job-specification/hcl2/expressions and job-specification/template, which the issue identifies as the relevant entry points. Add the documented delimiter-escaping example for a URL containing {{ID}}, explain why the plain form is parsed as a template function, and verify that the guidance matches the reported working form.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.