(operationName, zone string)
| 543 | |
| 544 | } |
| 545 | func (g *GCPClient) pollZoneOperationStatus(operationName, zone string) error { |
| 546 | for i := 0; i < timeout; i++ { |
| 547 | operation, err := g.compute.ZoneOperations.Get(g.projectName, zone, operationName).Do() |
| 548 | if err != nil { |
| 549 | return fmt.Errorf("error fetching operation status: %v", err) |
| 550 | } |
| 551 | if operation.Error != nil { |
| 552 | return fmt.Errorf("error running operation: %v", operation.Error) |
| 553 | } |
| 554 | if operation.Status == "DONE" { |
| 555 | return nil |
| 556 | } |
| 557 | time.Sleep(pollingInterval) |
| 558 | } |
| 559 | return fmt.Errorf("timeout waiting for operation to finish") |
| 560 | } |
no test coverage detected