Wait for the GCE disk creation operation to finish

This commit is contained in:
Will Noble 2025-07-22 20:31:01 -07:00
parent 3a9e01b8f8
commit d1449d2f1a
1 changed files with 6 additions and 1 deletions

View File

@ -119,9 +119,14 @@ func (_ *Disk) RenderGCE(t *gce.GCEAPITarget, a, e, changes *Disk) error {
}
if a == nil {
if _, err := cloud.Compute().Disks().Insert(t.Cloud.Project(), *e.Zone, disk); err != nil {
op, err := cloud.Compute().Disks().Insert(t.Cloud.Project(), *e.Zone, disk)
if err != nil {
return fmt.Errorf("error creating Disk: %v", err)
}
err = cloud.WaitForOp(op)
if err != nil {
return fmt.Errorf("error during Disk creation: %v", err)
}
}
if changes.Labels != nil {