From 5389ab1694e6ddbcaaa2815368dac85c209c65c2 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Tue, 18 Sep 2018 11:36:21 +0200 Subject: [PATCH] pass config as a pointer so that ssh configuration is correctly set --- builder/digitalocean/builder.go | 2 +- builder/digitalocean/step_create_droplet.go | 2 +- builder/digitalocean/step_droplet_info.go | 2 +- builder/digitalocean/step_power_off.go | 2 +- builder/digitalocean/step_shutdown.go | 2 +- builder/digitalocean/step_snapshot.go | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/builder/digitalocean/builder.go b/builder/digitalocean/builder.go index 276c6c539..6af14df46 100644 --- a/builder/digitalocean/builder.go +++ b/builder/digitalocean/builder.go @@ -71,7 +71,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe // Set up the state state := new(multistep.BasicStateBag) - state.Put("config", b.config) + state.Put("config", &b.config) state.Put("client", client) state.Put("hook", hook) state.Put("ui", ui) diff --git a/builder/digitalocean/step_create_droplet.go b/builder/digitalocean/step_create_droplet.go index 9c6c5712a..cfb1f4203 100644 --- a/builder/digitalocean/step_create_droplet.go +++ b/builder/digitalocean/step_create_droplet.go @@ -18,7 +18,7 @@ type stepCreateDroplet struct { func (s *stepCreateDroplet) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*godo.Client) ui := state.Get("ui").(packer.Ui) - c := state.Get("config").(Config) + c := state.Get("config").(*Config) sshKeyId := state.Get("ssh_key_id").(int) // Create the droplet based on configuration diff --git a/builder/digitalocean/step_droplet_info.go b/builder/digitalocean/step_droplet_info.go index 5c4439749..26c990d22 100644 --- a/builder/digitalocean/step_droplet_info.go +++ b/builder/digitalocean/step_droplet_info.go @@ -14,7 +14,7 @@ type stepDropletInfo struct{} func (s *stepDropletInfo) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*godo.Client) ui := state.Get("ui").(packer.Ui) - c := state.Get("config").(Config) + c := state.Get("config").(*Config) dropletID := state.Get("droplet_id").(int) ui.Say("Waiting for droplet to become active...") diff --git a/builder/digitalocean/step_power_off.go b/builder/digitalocean/step_power_off.go index 3b7e8bdd0..0ca9d6fc7 100644 --- a/builder/digitalocean/step_power_off.go +++ b/builder/digitalocean/step_power_off.go @@ -14,7 +14,7 @@ type stepPowerOff struct{} func (s *stepPowerOff) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*godo.Client) - c := state.Get("config").(Config) + c := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) dropletId := state.Get("droplet_id").(int) diff --git a/builder/digitalocean/step_shutdown.go b/builder/digitalocean/step_shutdown.go index 98d6c0c75..248aadd0a 100644 --- a/builder/digitalocean/step_shutdown.go +++ b/builder/digitalocean/step_shutdown.go @@ -15,7 +15,7 @@ type stepShutdown struct{} func (s *stepShutdown) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*godo.Client) - c := state.Get("config").(Config) + c := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) dropletId := state.Get("droplet_id").(int) diff --git a/builder/digitalocean/step_snapshot.go b/builder/digitalocean/step_snapshot.go index 0ccec359d..773626fa1 100644 --- a/builder/digitalocean/step_snapshot.go +++ b/builder/digitalocean/step_snapshot.go @@ -17,7 +17,7 @@ type stepSnapshot struct{} func (s *stepSnapshot) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*godo.Client) ui := state.Get("ui").(packer.Ui) - c := state.Get("config").(Config) + c := state.Get("config").(*Config) dropletId := state.Get("droplet_id").(int) var snapshotRegions []string