From 09489da149294c2792c27b201b7edf815bd6cef5 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Thu, 19 Dec 2019 11:17:04 -0800 Subject: [PATCH] update jdcloud statebag to use pointers for config, to bring in line with other implementations --- builder/jdcloud/builder.go | 2 +- builder/jdcloud/step_create_instance.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/jdcloud/builder.go b/builder/jdcloud/builder.go index 3e385d081..063bfda1f 100644 --- a/builder/jdcloud/builder.go +++ b/builder/jdcloud/builder.go @@ -46,7 +46,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack state := new(multistep.BasicStateBag) state.Put("hook", hook) state.Put("ui", ui) - state.Put("config", b.config) + state.Put("config", &b.config) steps := []multistep.Step{ diff --git a/builder/jdcloud/step_create_instance.go b/builder/jdcloud/step_create_instance.go index 353c7304d..4395b1932 100644 --- a/builder/jdcloud/step_create_instance.go +++ b/builder/jdcloud/step_create_instance.go @@ -142,7 +142,7 @@ func (s *stepCreateJDCloudInstance) Cleanup(state multistep.StateBag) { func createElasticIp(state multistep.StateBag) (string, error) { - generalConfig := state.Get("config").(Config) + generalConfig := state.Get("config").(*Config) regionId := generalConfig.RegionId credential := core.NewCredentials(generalConfig.AccessKey, generalConfig.SecretKey) vpcclient := vpcClient.NewVpcClient(credential)