hashicorp / hashicorp/nomad-pack

Embrace HCLv2 variables and rethink recommending go templates

Open
#150 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
447
Forks
65
PR merge metrics
No merged PRs in 30d

Description

HCL variables already allow for many things which currently are simply ugly in nomad-pack.
See https://github.com/hashicorp/nomad-pack/issues/72#issuecomment-949042509 vs
https://github.com/hashicorp/nomad-pack-community-registry/blob/c4116f1ca28b4a19327c95c45e7bf818564209a6/packs/traefik/templates/traefik.nomad.tpl#L3-L4

So what can we do against that? It imo is okay to use go-templates in cases where HCL does not suffice or for rendering text data (ie outputs.tpl). But given that we already define `variables.hcl` it would be very useful to have those show up in the job templates as hcl variables as well. This way one would not have to rely on go-templates so much.

What do you all think?

Contributor guide

Open the contributing guide

Research direction

Start by reading the linked discussion and comparing variables.hcl with the referenced traefik.nomad.tpl lines. Review how job templates and outputs.tpl currently use Go templates, then determine the intended boundary between HCL variables and Go templates. Done should include an agreed approach for the template behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.