pass config as a pointer so that ssh configuration is correctly set

This commit is contained in:
Adrien Delorme 2018-09-18 11:36:21 +02:00
parent 31bbe2983b
commit 5389ab1694
6 changed files with 6 additions and 6 deletions

View File

@ -71,7 +71,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
// Set up the state // Set up the state
state := new(multistep.BasicStateBag) state := new(multistep.BasicStateBag)
state.Put("config", b.config) state.Put("config", &b.config)
state.Put("client", client) state.Put("client", client)
state.Put("hook", hook) state.Put("hook", hook)
state.Put("ui", ui) state.Put("ui", ui)

View File

@ -18,7 +18,7 @@ type stepCreateDroplet struct {
func (s *stepCreateDroplet) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { func (s *stepCreateDroplet) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
client := state.Get("client").(*godo.Client) client := state.Get("client").(*godo.Client)
ui := state.Get("ui").(packer.Ui) ui := state.Get("ui").(packer.Ui)
c := state.Get("config").(Config) c := state.Get("config").(*Config)
sshKeyId := state.Get("ssh_key_id").(int) sshKeyId := state.Get("ssh_key_id").(int)
// Create the droplet based on configuration // Create the droplet based on configuration

View File

@ -14,7 +14,7 @@ type stepDropletInfo struct{}
func (s *stepDropletInfo) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { func (s *stepDropletInfo) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
client := state.Get("client").(*godo.Client) client := state.Get("client").(*godo.Client)
ui := state.Get("ui").(packer.Ui) ui := state.Get("ui").(packer.Ui)
c := state.Get("config").(Config) c := state.Get("config").(*Config)
dropletID := state.Get("droplet_id").(int) dropletID := state.Get("droplet_id").(int)
ui.Say("Waiting for droplet to become active...") ui.Say("Waiting for droplet to become active...")

View File

@ -14,7 +14,7 @@ type stepPowerOff struct{}
func (s *stepPowerOff) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { func (s *stepPowerOff) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
client := state.Get("client").(*godo.Client) client := state.Get("client").(*godo.Client)
c := state.Get("config").(Config) c := state.Get("config").(*Config)
ui := state.Get("ui").(packer.Ui) ui := state.Get("ui").(packer.Ui)
dropletId := state.Get("droplet_id").(int) dropletId := state.Get("droplet_id").(int)

View File

@ -15,7 +15,7 @@ type stepShutdown struct{}
func (s *stepShutdown) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { func (s *stepShutdown) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
client := state.Get("client").(*godo.Client) client := state.Get("client").(*godo.Client)
c := state.Get("config").(Config) c := state.Get("config").(*Config)
ui := state.Get("ui").(packer.Ui) ui := state.Get("ui").(packer.Ui)
dropletId := state.Get("droplet_id").(int) dropletId := state.Get("droplet_id").(int)

View File

@ -17,7 +17,7 @@ type stepSnapshot struct{}
func (s *stepSnapshot) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { func (s *stepSnapshot) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
client := state.Get("client").(*godo.Client) client := state.Get("client").(*godo.Client)
ui := state.Get("ui").(packer.Ui) ui := state.Get("ui").(packer.Ui)
c := state.Get("config").(Config) c := state.Get("config").(*Config)
dropletId := state.Get("droplet_id").(int) dropletId := state.Get("droplet_id").(int)
var snapshotRegions []string var snapshotRegions []string