Nomad-pack render - Question regarding heredoc variables

Hello.

I have a pack, and I pass a variable as heredoc-string as input to a variable.

As an similar example, I’ll use the prometheus pack in the community registry (“prometheus_task_app_prometheus_yaml”).

I call the “render” function, but then I have issues with using single “%” in the heredoc:

  • nomad-pack render prometheus --var-file=example.hcl (using techpreview2)
# example.hcl
prometheus_task_app_prometheus_yaml = <<EOH
%example%
EOH

# RESULT 1

(..snip..)
template {
       data = <<EOH
%!e(MISSING)xample%!
(MISSING)
EOH
# example.hcl
prometheus_task_app_prometheus_yaml = <<EOH
%%example%%
EOH
(..snip..)

# RESULT 2

(..snip..)
template {
        data = <<EOH
%example%

EOH
(..snip..)

If I call nomad-pack run, it works as expected:

  • Example 1 renderes the template with single “%”, and no error in text
  • Example 2 renders the template with double “%”

Anyone who can explain if this is a bug, or something I’m missing?