builder/googlecompute: Store empty public_key
This commit is contained in:
parent
7f474d8f78
commit
583e341ae7
|
@ -69,13 +69,9 @@ func getImage(c *Config, d Driver) (*Image, error) {
|
||||||
func (s *StepCreateInstance) Run(state multistep.StateBag) multistep.StepAction {
|
func (s *StepCreateInstance) Run(state multistep.StateBag) multistep.StepAction {
|
||||||
c := state.Get("config").(*Config)
|
c := state.Get("config").(*Config)
|
||||||
d := state.Get("driver").(Driver)
|
d := state.Get("driver").(Driver)
|
||||||
|
sshPublicKey := state.Get("ssh_public_key").(string)
|
||||||
ui := state.Get("ui").(packer.Ui)
|
ui := state.Get("ui").(packer.Ui)
|
||||||
|
|
||||||
sshPublicKey := ""
|
|
||||||
if sshPublicKeyRaw, ok := state.GetOk("ssh_public_key"); ok {
|
|
||||||
sshPublicKey = sshPublicKeyRaw.(string)
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceImage, err := getImage(c, d)
|
sourceImage, err := getImage(c, d)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err := fmt.Errorf("Error getting source image for instance creation: %s", err)
|
err := fmt.Errorf("Error getting source image for instance creation: %s", err)
|
||||||
|
|
|
@ -37,6 +37,7 @@ func (s *StepCreateSSHKey) Run(state multistep.StateBag) multistep.StepAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
state.Put("ssh_private_key", string(privateKeyBytes))
|
state.Put("ssh_private_key", string(privateKeyBytes))
|
||||||
|
state.Put("ssh_public_key", "")
|
||||||
|
|
||||||
return multistep.ActionContinue
|
return multistep.ActionContinue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue