mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-11 09:40:17 -04:00
fix source accessor to allow use in source block
This commit is contained in:
parent
7ebc85564b
commit
cdde5cbbe2
1 changed files with 6 additions and 0 deletions
|
|
@ -110,6 +110,12 @@ func (cfg *PackerConfig) startBuilder(source SourceUseBlock, ectx *hcl.EvalConte
|
|||
}
|
||||
|
||||
body := source.Body
|
||||
// Add known values to source accessor in eval context.
|
||||
ectx.Variables[sourcesAccessor] = cty.ObjectVal(map[string]cty.Value{
|
||||
"type": cty.StringVal(source.Type),
|
||||
"name": cty.StringVal(source.Name),
|
||||
})
|
||||
|
||||
decoded, moreDiags := decodeHCL2Spec(body, ectx, builder)
|
||||
diags = append(diags, moreDiags...)
|
||||
if moreDiags.HasErrors() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue