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.
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:This changes the behavior and uses the GCE service account only if there is no service account in the configuration.
Closes #5