hashicorp / packer-plugin-googlecompute

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

Use user-configured Service Account for public key import when running in GCE #33

Closed jonsulman closed 2 years ago

jonsulman commented 3 years ago

When running on a Compute Engine instance, StepImportOSLoginSSHKey uses the account name from the GCE instance even if a different service account is configured. This can cause Packer to authenticate to Google API using the configured service account but attempt to create an SSH key for the GCE service account, resulting in an error:

googleapi: Error 403: End user credentials must match the user specified in the request

This changes the behavior and uses the GCE service account only if there is no service account in the configuration.

Closes #5

hashicorp-cla commented 3 years ago

CLA assistant check
All committers have signed the CLA.

rickfoster101 commented 2 years ago

Running into this too. When can we expect a review and release? Thx.