(operationName string)
| 526 | } |
| 527 | |
| 528 | func (g *GCPClient) pollOperationStatus(operationName string) error { |
| 529 | for i := 0; i < timeout; i++ { |
| 530 | operation, err := g.compute.GlobalOperations.Get(g.projectName, operationName).Do() |
| 531 | if err != nil { |
| 532 | return fmt.Errorf("error fetching operation status: %v", err) |
| 533 | } |
| 534 | if operation.Error != nil { |
| 535 | return fmt.Errorf("error running operation: %v", operation.Error) |
| 536 | } |
| 537 | if operation.Status == "DONE" { |
| 538 | return nil |
| 539 | } |
| 540 | time.Sleep(pollingInterval) |
| 541 | } |
| 542 | return fmt.Errorf("timeout waiting for operation to finish") |
| 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() |
no test coverage detected