in pkg/clients/ssl/ssl.go [134:158]
func (s impl) waitFor(ctx context.Context, operationName string) error {
for {
klog.Infof("Wait for operation %s", operationName)
operation, err := s.service.GlobalOperations.Get(s.projectID, operationName).Do()
if err != nil {
return fmt.Errorf("could not get operation %s: %v", operationName, err)
}
if operation.Status == statusDone {
klog.Infof("Operation %s done", operationName)
if operation.Error == nil {
return nil
}
return &Error{operation: operation}
}
select {
case <-ctx.Done():
return ctx.Err()
case <-time.After(10 * time.Second):
}
}
}