fix bad interpolation exemption for volume_size

This commit is contained in:
Megan Marsh 2018-11-29 16:36:40 -08:00
parent c29268a5d2
commit c03894c05d
1 changed files with 11 additions and 7 deletions

View File

@ -36,18 +36,22 @@ type Builder struct {
runner multistep.Runner
}
type EngineVarsTemplate struct {
BuildRegion string
SourceAMI string
}
func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
b.config.ctx.Funcs = awscommon.TemplateFuncs
// Create passthrough for {{ .BuildRegion }} and {{ .SourceAMI }} variables
// so we can fill them in later
b.config.ctx.Data = &EngineVarsTemplate{
BuildRegion: `{{ .BuildRegion }}`,
SourceAMI: `{{ .SourceAMI }} `,
}
err := config.Decode(&b.config, &config.DecodeOpts{
Interpolate: true,
InterpolateContext: &b.config.ctx,
InterpolateFilter: &interpolate.RenderFilter{
Exclude: []string{
"run_tags",
"spot_tags",
"ebs_volumes",
},
},
}, raws...)
if err != nil {
return nil, err