From f5ffc112bf629c13d501c8edf3364979c295df20 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Wed, 6 Sep 2023 11:07:35 -0400 Subject: [PATCH] hcl2template: remove value validation for locals Local variables can't have a validation block in their definition, so this step in not useful and should be removed. Besides, since the validation was done on the local variables before evaluation, it did nothing at all, as the PackerConfig.LocalVariables collection gets populated during evaluation, so this is essentially a no-op, and can be safely removed. --- hcl2template/parser.go | 1 - 1 file changed, 1 deletion(-) diff --git a/hcl2template/parser.go b/hcl2template/parser.go index fc9182bf0..c372a7733 100644 --- a/hcl2template/parser.go +++ b/hcl2template/parser.go @@ -295,7 +295,6 @@ func filterVarsFromLogs(inputOrLocal Variables) { func (cfg *PackerConfig) Initialize(opts packer.InitializeOptions) hcl.Diagnostics { diags := cfg.InputVariables.ValidateValues() - diags = append(diags, cfg.LocalVariables.ValidateValues()...) diags = append(diags, cfg.evaluateDatasources(opts.SkipDatasourcesExecution)...) diags = append(diags, checkForDuplicateLocalDefinition(cfg.LocalBlocks)...) diags = append(diags, cfg.evaluateLocalVariables(cfg.LocalBlocks)...)