hashicorp/nomad-pack

Variable file overrides not working as intended

dkyanakiev opened this issue · 0 comments

Hi,

I have a specific question and a problem. When doing the poc initially before 0.1.0 - this behaviour worked as expected but I see it has changed and I'm trying see how to properly solve this issue.

In both parser (v1 and v2) - variable files are being sorted

The comment there is that its added for consistency but I cant understand the need for it.
Lets say we have 2 variable files
cluster-defaults.hcl

namespace="default"

team-defaults.hcl

namespace="team-two"

Now assuming once doing any commands we feed in multiple files with multiple var files.

nomad-pack render myjobpack -f cluster-defaults.hcl -f team-defaults.hcl

Before this worked as expected but now the files are sorted and you can't know which one overwrited which. Unlike all the other type of variables which have If the same key is supplied twice, the last wins. for them.

This can be bypassed if filenames are adjusted but there shouldn't be a need for it.

Was this added as an oversight or something that I might be missing as reason for it?