hashicorp / packer-plugin-googlecompute

Packer plugin for Google Compute Builder
https://www.packer.io/docs/builders/googlecompute
Mozilla Public License 2.0
25 stars 54 forks source link

builder: no delete logs OSLogin ssh key if not set #162

Closed lbajolet-hashicorp closed 1 year ago

lbajolet-hashicorp commented 1 year ago

Because of SDK updates to the SSHKeyGen step, we automatically set the SSHPublicKey in the communicator when a SSHPrivateKeyFile is set in the template.

This invalidates some conditions in the instance creation logic, and with the OSLogin key upload step, as both relied on the value of SSHPublicKey to make a decision.

To prevent this, we only upload the SSH public key when no private key file is specified in the template, thereby making the plugin behave as it had prior to updating the SDK to newer versions that v0.3.2.

Closes #161