post-processor/*: fix interpolation context
This commit is contained in:
parent
4dc4fa81b9
commit
5241d8c6d6
|
@ -54,6 +54,7 @@ type PostProcessor struct {
|
|||
func (p *PostProcessor) Configure(raws ...interface{}) error {
|
||||
err := config.Decode(&p.config, &config.DecodeOpts{
|
||||
Interpolate: true,
|
||||
InterpolateContext: &p.config.ctx,
|
||||
InterpolateFilter: &interpolate.RenderFilter{
|
||||
Exclude: []string{},
|
||||
},
|
||||
|
|
|
@ -31,7 +31,7 @@ type Config struct {
|
|||
Archive string
|
||||
Algorithm string
|
||||
|
||||
ctx *interpolate.Context
|
||||
ctx interpolate.Context
|
||||
}
|
||||
|
||||
type PostProcessor struct {
|
||||
|
@ -53,6 +53,7 @@ var (
|
|||
func (p *PostProcessor) Configure(raws ...interface{}) error {
|
||||
err := config.Decode(&p.config, &config.DecodeOpts{
|
||||
Interpolate: true,
|
||||
InterpolateContext: &p.config.ctx,
|
||||
InterpolateFilter: &interpolate.RenderFilter{
|
||||
Exclude: []string{},
|
||||
},
|
||||
|
@ -69,7 +70,7 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
|
|||
p.config.OutputPath = "packer_{{.BuildName}}_{{.Provider}}"
|
||||
}
|
||||
|
||||
if err = interpolate.Validate(p.config.OutputPath, p.config.ctx); err != nil {
|
||||
if err = interpolate.Validate(p.config.OutputPath, &p.config.ctx); err != nil {
|
||||
errs = packer.MultiErrorAppend(
|
||||
errs, fmt.Errorf("Error parsing target template: %s", err))
|
||||
}
|
||||
|
@ -94,7 +95,7 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
|
|||
errs, fmt.Errorf("%s must be set", key))
|
||||
}
|
||||
|
||||
*ptr, err = interpolate.Render(p.config.OutputPath, p.config.ctx)
|
||||
*ptr, err = interpolate.Render(p.config.OutputPath, &p.config.ctx)
|
||||
if err != nil {
|
||||
errs = packer.MultiErrorAppend(
|
||||
errs, fmt.Errorf("Error processing %s: %s", key, err))
|
||||
|
|
|
@ -28,6 +28,7 @@ type PostProcessor struct {
|
|||
func (p *PostProcessor) Configure(raws ...interface{}) error {
|
||||
err := config.Decode(&p.config, &config.DecodeOpts{
|
||||
Interpolate: true,
|
||||
InterpolateContext: &p.config.ctx,
|
||||
InterpolateFilter: &interpolate.RenderFilter{
|
||||
Exclude: []string{},
|
||||
},
|
||||
|
|
|
@ -34,6 +34,7 @@ type PostProcessor struct {
|
|||
func (p *PostProcessor) Configure(raws ...interface{}) error {
|
||||
err := config.Decode(&p.config, &config.DecodeOpts{
|
||||
Interpolate: true,
|
||||
InterpolateContext: &p.config.ctx,
|
||||
InterpolateFilter: &interpolate.RenderFilter{
|
||||
Exclude: []string{},
|
||||
},
|
||||
|
|
|
@ -32,6 +32,7 @@ type PostProcessor struct {
|
|||
func (p *PostProcessor) Configure(raws ...interface{}) error {
|
||||
err := config.Decode(&p.config, &config.DecodeOpts{
|
||||
Interpolate: true,
|
||||
InterpolateContext: &p.config.ctx,
|
||||
InterpolateFilter: &interpolate.RenderFilter{
|
||||
Exclude: []string{},
|
||||
},
|
||||
|
|
|
@ -32,6 +32,7 @@ type PostProcessor struct {
|
|||
func (p *PostProcessor) Configure(raws ...interface{}) error {
|
||||
err := config.Decode(&p.config, &config.DecodeOpts{
|
||||
Interpolate: true,
|
||||
InterpolateContext: &p.config.ctx,
|
||||
InterpolateFilter: &interpolate.RenderFilter{
|
||||
Exclude: []string{},
|
||||
},
|
||||
|
|
|
@ -48,6 +48,7 @@ type PostProcessor struct {
|
|||
func (p *PostProcessor) Configure(raws ...interface{}) error {
|
||||
err := config.Decode(&p.config, &config.DecodeOpts{
|
||||
Interpolate: true,
|
||||
InterpolateContext: &p.config.ctx,
|
||||
InterpolateFilter: &interpolate.RenderFilter{
|
||||
Exclude: []string{
|
||||
"box_download_url",
|
||||
|
|
|
@ -172,6 +172,7 @@ func (p *PostProcessor) configureSingle(c *Config, raws ...interface{}) error {
|
|||
err := config.Decode(c, &config.DecodeOpts{
|
||||
Metadata: &md,
|
||||
Interpolate: true,
|
||||
InterpolateContext: &c.ctx,
|
||||
InterpolateFilter: &interpolate.RenderFilter{
|
||||
Exclude: []string{
|
||||
"output",
|
||||
|
|
|
@ -44,6 +44,7 @@ type PostProcessor struct {
|
|||
func (p *PostProcessor) Configure(raws ...interface{}) error {
|
||||
err := config.Decode(&p.config, &config.DecodeOpts{
|
||||
Interpolate: true,
|
||||
InterpolateContext: &p.config.ctx,
|
||||
InterpolateFilter: &interpolate.RenderFilter{
|
||||
Exclude: []string{},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue