diff --git a/builder/jdcloud/builder.go b/builder/jdcloud/builder.go index 3e385d08194..063bfda1fd0 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 353c7304dd5..4395b19325b 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)