Conversation
| } | ||
|
|
||
| generatedVars, warning, err := builder.Prepare(decoded) | ||
| generatedVars, warning, err := builder.Prepare(source.builderVariables(), decoded) |
There was a problem hiding this comment.
Here we use the properties of mapstructure to first pass on the builder variables then set the decoded values from an hcl config file. This allows to not have to manually default this for every builder/provisioner/post-processor
| if p.config.StripTime { | ||
| artifact.BuildTime = 0 | ||
| } |
There was a problem hiding this comment.
This allows to make my test based on the content of the manifest.json file. Without this build_time changes all the time.
Codecov Report
|
|
Is all the website stuff failing because you need to rebase? |
|
I think so yes; rebasing now |
|
Okay it's all green, I think this can be merged. |
|
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. |
Howdy ! This :
packer_build_nameandpacker_builder_typevariables for builder provisioners and post-processors in HCL2${source.type}and${source.name}variables in HCL2 [ this is not required but this was the route I first took in order to test this and this has helped me a little, so I decided to leave it, please tell me if you think this is a bad idea ]Note that the common.PackerConfig is used everywhere and was not set for HCL2, this had some implications:
For #8932 you can see the issue here:
packer/builder/lxd/config.go
Lines 61 to 63 in dde7423
More random examples of where this could cause an issue :
packer/provisioner/ansible-local/provisioner.go
Lines 380 to 381 in 0785c2f
packer/builder/amazon/ebs/builder.go
Lines 232 to 236 in b4efd13
All references to PackerConfig.PackerBuildName
All references to PackerConfig.PackerBuilderType