I have noticed that in latest packer (1.5.5) it is no longer valid rule that inline variables can overwrite file variables. We have used file for some variables, but sometimes we want to overwrite them with inline changes.
cat variable.json
{
"GIT_COMMIT" : "NULL"
}
cat docker.json
{
"builders":[
{
"type": "docker",
....
packer build -var-file=variable.json -var GIT_COMMIT="abcdefabcdef" docker.json
====
Expecting to use "_abcdefabcdef_" string for GIT_COMMIT as it was in previous packer versions (1.5.4 or any earlier version). But got GIT_COMMIT=NULL
Couldn't find information in CHANGELOG anything about this, so not sure if it's a new approach to work with variables, or it is a bug. Thanks.
Hello there! Thanks for reaching out. We’ll take a look when we get a chance.
Sorry about this regression. It looks like we accidentally introduced this in https://github.com/hashicorp/packer/commit/c8300b620a581f3c2fa9f505621f35d568f4a25a when we were adding hcl2 variable file support. I'm working on a fix now.
Hi, I've got a PR open to fix this, linked above. Binaries containing the above patch can be downloaded from our ci server here: https://circleci.com/gh/hashicorp/packer/41897#artifacts/containers/0
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.