Merge pull request #10224 from hashicorp/fix_tag_interpolation

fix single tag interpolation to allow golang template engine usage
This commit is contained in:
Megan Marsh 2020-11-06 11:05:24 -08:00 committed by GitHub
commit 396b0237fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 0 deletions

View File

@ -201,8 +201,11 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, []string, error) {
Exclude: []string{ Exclude: []string{
"ami_description", "ami_description",
"snapshot_tags", "snapshot_tags",
"snapshot_tag",
"tags", "tags",
"tag",
"root_volume_tags", "root_volume_tags",
"root_volume_tag",
"command_wrapper", "command_wrapper",
"post_mount_commands", "post_mount_commands",
"pre_mount_commands", "pre_mount_commands",

View File

@ -92,10 +92,15 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, []string, error) {
Exclude: []string{ Exclude: []string{
"ami_description", "ami_description",
"run_tags", "run_tags",
"run_tag",
"run_volume_tags", "run_volume_tags",
"run_volume_tag",
"spot_tags", "spot_tags",
"spot_tag",
"snapshot_tags", "snapshot_tags",
"snapshot_tag",
"tags", "tags",
"tag",
}, },
}, },
}, raws...) }, raws...)

View File

@ -91,10 +91,15 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, []string, error) {
Exclude: []string{ Exclude: []string{
"ami_description", "ami_description",
"run_tags", "run_tags",
"run_tag",
"run_volume_tags", "run_volume_tags",
"run_volume_tag",
"snapshot_tags", "snapshot_tags",
"snapshot_tag",
"spot_tags", "spot_tags",
"spot_tag",
"tags", "tags",
"tag",
}, },
}, },
}, raws...) }, raws...)

View File

@ -103,6 +103,18 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, []string, error) {
PluginType: BuilderId, PluginType: BuilderId,
Interpolate: true, Interpolate: true,
InterpolateContext: &b.config.ctx, InterpolateContext: &b.config.ctx,
InterpolateFilter: &interpolate.RenderFilter{
Exclude: []string{
"run_tags",
"run_tag",
"run_volume_tags",
"run_volume_tag",
"spot_tags",
"spot_tag",
"tags",
"tag",
},
},
}, raws...) }, raws...)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err