builder/amazon/ebs: pass config as a pointer so values could be populated by a run

This commit is contained in:
Adrien Delorme 2018-09-18 15:50:37 +02:00
parent 2d899ffcee
commit 22d3e9b5c4
3 changed files with 3 additions and 3 deletions

View File

@ -112,7 +112,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
// Setup the state bag and initial state for the steps // Setup the state bag and initial state for the steps
state := new(multistep.BasicStateBag) state := new(multistep.BasicStateBag)
state.Put("config", b.config) state.Put("config", &b.config)
state.Put("ec2", ec2conn) state.Put("ec2", ec2conn)
state.Put("awsSession", session) state.Put("awsSession", session)
state.Put("hook", hook) state.Put("hook", hook)

View File

@ -17,7 +17,7 @@ type stepCreateAMI struct {
} }
func (s *stepCreateAMI) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { func (s *stepCreateAMI) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction {
config := state.Get("config").(Config) config := state.Get("config").(*Config)
ec2conn := state.Get("ec2").(*ec2.EC2) ec2conn := state.Get("ec2").(*ec2.EC2)
instance := state.Get("instance").(*ec2.Instance) instance := state.Get("instance").(*ec2.Instance)
ui := state.Get("ui").(packer.Ui) ui := state.Get("ui").(packer.Ui)

View File

@ -111,7 +111,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
// Setup the state bag and initial state for the steps // Setup the state bag and initial state for the steps
state := new(multistep.BasicStateBag) state := new(multistep.BasicStateBag)
state.Put("config", b.config) state.Put("config", &b.config)
state.Put("ec2", ec2conn) state.Put("ec2", ec2conn)
state.Put("hook", hook) state.Put("hook", hook)
state.Put("ui", ui) state.Put("ui", ui)