GCE: Rename image in tar file to disk.raw

To register with GCE, the image must be named disk.raw, or else the
gcloud create images command fails.
This commit is contained in:
Justin Santa Barbara 2016-04-17 12:09:59 -04:00
parent 4b34cb2615
commit be595efd99

View file

@ -30,8 +30,11 @@ class CreateTarball(Task):
tarball_path = os.path.join(info.manifest.bootstrapper['workspace'], tarball_name) tarball_path = os.path.join(info.manifest.bootstrapper['workspace'], tarball_name)
info._gce['tarball_name'] = tarball_name info._gce['tarball_name'] = tarball_name
info._gce['tarball_path'] = tarball_path info._gce['tarball_path'] = tarball_path
# GCE requires that the file in the tar be named disk.raw, hence the transform
log_check_call(['tar', '--sparse', '-C', info.manifest.bootstrapper['workspace'], log_check_call(['tar', '--sparse', '-C', info.manifest.bootstrapper['workspace'],
'-caf', tarball_path, filename]) '-caf', tarball_path,
'--transform=s|.*|disk.raw|',
filename])
class UploadImage(Task): class UploadImage(Task):