packer/hcl2template
Lucas Bajolet 8d6b8da996 hcl2template: locals evaluation returns a variable
Evaluating local variables used to be directly written to the
PackerConfig while each variable was created.

This was somewhat of an issue with testing, as we have a bunch of tests
that relied on `PackerConfig.Variables` being set only when we actually
write something.

This is not really a concern for normal use, just for testing, but to
limit the number of changes to the tests in hcl2template, I opted to
change how variables' values are retained, so that evaluating a single
variable returns a Variable in addition to hcl.Diagnostics, so we can
reify the approach and only create the map of variables if there's
something evaluated.
2024-10-29 16:10:29 -04:00
..
addrs addrs: require at least 3 parts to source URIs 2024-05-15 14:12:41 -04:00
fixtures hcl2: fix crash on malformed overrides (#11881) 2022-07-20 14:30:49 -04:00
function Add base64gzip function support to Packer template 2024-08-13 14:53:29 -04:00
internal [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
repl [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
shim [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
testdata hcl2template: check bucket name at parse-time 2024-01-31 09:56:57 -05:00
common_test.go packer: address unused lint errors 2024-07-18 10:51:17 -04:00
components.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
decode.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
docs.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
formatter.go fmt: print parse errors on error 2024-03-07 14:41:19 -05:00
formatter_test.go chore: remove refs to deprecated io/ioutil 2023-09-26 11:13:31 -04:00
functions.go Add base64gzip function support to Packer template 2024-08-13 14:53:29 -04:00
parser.go hcl2template: locals evaluation returns a variable 2024-10-29 16:10:29 -04:00
plugin.go packer: register plugin components only once 2024-05-14 11:41:18 -04:00
types.build.from.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
types.build.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
types.build.hcp_packer_registry.go hcl2template: check bucket name at parse-time 2024-01-31 09:56:57 -05:00
types.build.hcp_packer_registry_test.go Packer tracks Version and Plugins Metadata (#12860) 2024-04-11 12:55:04 -04:00
types.build.post-processor.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
types.build.provisioners.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
types.build.provisioners_test.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
types.build_test.go Packer tracks Version and Plugins Metadata (#12860) 2024-04-11 12:55:04 -04:00
types.datasource.go hcl2template: use refString for local/data deps 2024-10-29 16:10:29 -04:00
types.datasource_test.go hcl2template: locals evaluation returns a variable 2024-10-29 16:10:29 -04:00
types.hcl_post-processor.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
types.hcl_provisioner.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
types.hcl_ref.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
types.packer_config.go hcl2template: locals evaluation returns a variable 2024-10-29 16:10:29 -04:00
types.packer_config_test.go hcl2template: rename Datasource.Name to DSName 2024-10-29 16:10:29 -04:00
types.refstring.go hcl2template: rename Name->LocalName for local 2024-10-29 16:10:29 -04:00
types.required_plugins.go commands: reject constraints with pre-releases (#12999) 2024-05-30 14:25:21 +02:00
types.required_plugins_test.go packer: relax constraints on sources 2024-04-29 14:28:24 -04:00
types.source.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
types.source_test.go Packer tracks Version and Plugins Metadata (#12860) 2024-04-11 12:55:04 -04:00
types.variables.go hcl2template: rename Name->LocalName for local 2024-10-29 16:10:29 -04:00
types.variables_test.go hcl2template: locals evaluation returns a variable 2024-10-29 16:10:29 -04:00
utils.go hcl2template: split GetVarsByType in two functions 2024-06-17 16:51:58 -04:00
version.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
version_required.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00