builder/googlecompute: fix dropped error (#8385)

This commit is contained in:
Lars Lehtonen 2019-11-19 02:41:39 -08:00 committed by Adrien Delorme
parent ad74a87b5c
commit 3571c585bb
1 changed files with 4 additions and 0 deletions

View File

@ -493,6 +493,10 @@ func (d *driverGCE) createWindowsPassword(errCh chan<- error, name, zone string,
dCopy := string(data)
instance, err := d.service.Instances.Get(d.projectId, zone, name).Do()
if err != nil {
errCh <- err
return
}
instance.Metadata.Items = append(instance.Metadata.Items, &compute.MetadataItems{Key: "windows-keys", Value: &dCopy})
op, err := d.service.Instances.SetMetadata(d.projectId, zone, name, &compute.Metadata{