Skip to content

Commit 909c8a2

Browse files
committed
Replace Get operations with polling
1 parent 82a4f6c commit 909c8a2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/gce-cloud-provider/compute/gce-compute.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,7 @@ func (cloud *CloudProvider) getRegionalDiskTypeURI(project string, region, diskT
10661066
func (cloud *CloudProvider) waitForZonalOp(ctx context.Context, project, opName string, zone string) error {
10671067
// The v1 API can query for v1, alpha, or beta operations.
10681068
return wait.ExponentialBackoff(WaitForOpBackoff, func() (bool, error) {
1069-
pollOp, err := cloud.service.ZoneOperations.Get(project, zone, opName).Context(ctx).Do()
1069+
pollOp, err := cloud.service.ZoneOperations.Wait(project, zone, opName).Context(ctx).Do()
10701070
if err != nil {
10711071
klog.Errorf("WaitForOp(op: %s, zone: %#v) failed to poll the operation", opName, zone)
10721072
return false, err
@@ -1079,7 +1079,7 @@ func (cloud *CloudProvider) waitForZonalOp(ctx context.Context, project, opName
10791079
func (cloud *CloudProvider) waitForRegionalOp(ctx context.Context, project, opName string, region string) error {
10801080
// The v1 API can query for v1, alpha, or beta operations.
10811081
return wait.ExponentialBackoff(WaitForOpBackoff, func() (bool, error) {
1082-
pollOp, err := cloud.service.RegionOperations.Get(project, region, opName).Context(ctx).Do()
1082+
pollOp, err := cloud.service.RegionOperations.Wait(project, region, opName).Context(ctx).Do()
10831083
if err != nil {
10841084
klog.Errorf("WaitForOp(op: %s, region: %#v) failed to poll the operation", opName, region)
10851085
return false, err
@@ -1091,7 +1091,7 @@ func (cloud *CloudProvider) waitForRegionalOp(ctx context.Context, project, opNa
10911091

10921092
func (cloud *CloudProvider) waitForGlobalOp(ctx context.Context, project, opName string) error {
10931093
return wait.ExponentialBackoff(WaitForOpBackoff, func() (bool, error) {
1094-
pollOp, err := cloud.service.GlobalOperations.Get(project, opName).Context(ctx).Do()
1094+
pollOp, err := cloud.service.GlobalOperations.Wait(project, opName).Context(ctx).Do()
10951095
if err != nil {
10961096
klog.Errorf("waitForGlobalOp(op: %s) failed to poll the operation", opName)
10971097
return false, err

0 commit comments

Comments
 (0)