Fixes the following vet reports:
builder/googlecompute/step_create_instance_test.go:42: possible formatting directive in Fatal call
builder/googlecompute/step_teardown_instance_test.go:29: possible formatting directive in Fatal call
builder/googlecompute/step_teardown_instance_test.go:39: possible formatting directive in Fatal call
The new flow:
1) Provision the instance
2) Tear down the instance, but keep the boot disk
3) Create an image from the disk
4) Tear down the disk
The step to update gcloud is no longer needed, since gceimagebundle isn't used anymore.
Fixes#1507 and addresses https://github.com/mitchellh/packer/issues/1447#issuecomment-61610235.
Previously, any per instance metadata supplied via the GCE builder
was ignored.
Test plan:
- make test
- Manual testing via:
-- Created a packer config that contained a GCE builder with custom
metadata set.
-- Ran `packer build`.
-- Verified the instance had the correct metadata in the GCE console.
In order that something consuming an artifact can have access to extra
builder specific data add the State method which allows the caller to
ask for arbitary values by name.
Within GCE, images may be shared across projects. Prior to this
commit, there was no way to inform the GCE builder that a source
image belonged to a specific project. This adds an optional
'source_image_project_id' key to the GCE builder config.
Also fixed the error message to be clear that the image was not found in any of
the projects that we attempted to search, rather than keep the error message
from the last project, which may be confusing to users.
googlecompute: It looks like you are trying to run "/usr/local/bin/../share/google/google-cloud-sdk/bin/bootstrapping/gsutil.py update".
googlecompute: The "update" command is no longer needed with the Cloud SDK.
googlecompute: To update, run: gcloud components update
Retain the current default of an instance name generated by UUID, but allow
users to choose a specific one. Useful for provisioning with Puppet when a
node name is used to select the right manifest.