diff --git a/hcl2template/mock.go b/hcl2template/mock.go index 09fbf0c19..8576a0439 100644 --- a/hcl2template/mock.go +++ b/hcl2template/mock.go @@ -40,8 +40,8 @@ var _ packer.Builder = new(MockBuilder) func (b *MockBuilder) ConfigSpec() hcldec.ObjectSpec { return b.Config.FlatMapstructure().HCL2Spec() } -func (b *MockBuilder) Prepare(raws ...interface{}) ([]string, error) { - return nil, config.Decode(&b.Config, &config.DecodeOpts{ +func (b *MockBuilder) Prepare(raws ...interface{}) ([]string, []string, error) { + return nil, nil, config.Decode(&b.Config, &config.DecodeOpts{ Interpolate: true, }, raws...) } @@ -70,7 +70,7 @@ func (b *MockProvisioner) Prepare(raws ...interface{}) error { }, raws...) } -func (b *MockProvisioner) Provision(ctx context.Context, ui packer.Ui, comm packer.Communicator) error { +func (b *MockProvisioner) Provision(ctx context.Context, ui packer.Ui, comm packer.Communicator, _ map[string]interface{}) error { return nil } diff --git a/hcl2template/types.source.go b/hcl2template/types.source.go index f86ab4b69..7b1216e2a 100644 --- a/hcl2template/types.source.go +++ b/hcl2template/types.source.go @@ -61,7 +61,8 @@ func (p *Parser) StartBuilder(source *Source) (packer.Builder, hcl.Diagnostics) if moreDiags.HasErrors() { return nil, diags } - warning, err := builder.Prepare(decoded) + + _, warning, err := builder.Prepare(decoded) moreDiags = warningErrorsToDiags(source.block, warning, err) diags = append(diags, moreDiags...) return builder, diags