From 22d3e9b5c4d0725283110b7f2ad9b9821eb7df4a Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Tue, 18 Sep 2018 15:50:37 +0200 Subject: [PATCH] builder/amazon/ebs: pass config as a pointer so values could be populated by a run --- builder/amazon/ebs/builder.go | 2 +- builder/amazon/ebs/step_create_ami.go | 2 +- builder/amazon/ebsvolume/builder.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/builder/amazon/ebs/builder.go b/builder/amazon/ebs/builder.go index 1bb00b325..1980a770d 100644 --- a/builder/amazon/ebs/builder.go +++ b/builder/amazon/ebs/builder.go @@ -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 state := new(multistep.BasicStateBag) - state.Put("config", b.config) + state.Put("config", &b.config) state.Put("ec2", ec2conn) state.Put("awsSession", session) state.Put("hook", hook) diff --git a/builder/amazon/ebs/step_create_ami.go b/builder/amazon/ebs/step_create_ami.go index 8d9049f85..d8f78793d 100644 --- a/builder/amazon/ebs/step_create_ami.go +++ b/builder/amazon/ebs/step_create_ami.go @@ -17,7 +17,7 @@ type stepCreateAMI struct { } 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) instance := state.Get("instance").(*ec2.Instance) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/ebsvolume/builder.go b/builder/amazon/ebsvolume/builder.go index 781925fea..643b55a2a 100644 --- a/builder/amazon/ebsvolume/builder.go +++ b/builder/amazon/ebsvolume/builder.go @@ -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 state := new(multistep.BasicStateBag) - state.Put("config", b.config) + state.Put("config", &b.config) state.Put("ec2", ec2conn) state.Put("hook", hook) state.Put("ui", ui)