packer: Send packerConfig into PostProcessors
This commit is contained in:
parent
fc78bf3dd6
commit
400faa57a5
@ -121,7 +121,8 @@ func (b *coreBuild) Prepare() (err error) {
|
|||||||
// Prepare the post-processors
|
// Prepare the post-processors
|
||||||
for _, ppSeq := range b.postProcessors {
|
for _, ppSeq := range b.postProcessors {
|
||||||
for _, corePP := range ppSeq {
|
for _, corePP := range ppSeq {
|
||||||
if err = corePP.processor.Configure(corePP.config); err != nil {
|
err = corePP.processor.Configure(corePP.config, packerConfig)
|
||||||
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ func TestBuild_Prepare(t *testing.T) {
|
|||||||
corePP := build.postProcessors[0][0]
|
corePP := build.postProcessors[0][0]
|
||||||
pp := corePP.processor.(*TestPostProcessor)
|
pp := corePP.processor.(*TestPostProcessor)
|
||||||
assert.True(pp.configCalled, "config should be called")
|
assert.True(pp.configCalled, "config should be called")
|
||||||
assert.Equal(pp.configVal, []interface{}{42}, "config should have right value")
|
assert.Equal(pp.configVal, []interface{}{42, packerConfig}, "config should have right value")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBuild_Prepare_Twice(t *testing.T) {
|
func TestBuild_Prepare_Twice(t *testing.T) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user