Skip to content

Commit 9c29cd8

Browse files
andyzhangxk8s-infra-cherrypick-robot
authored andcommitted
cleanup: remove deprecated wait.PollImediate function
fix
1 parent e1852f8 commit 9c29cd8

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pkg/blob/controllerserver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ func (d *Driver) copyBlobContainer(ctx context.Context, req *csi.CreateVolumeReq
807807
case util.AzcopyJobError, util.AzcopyJobCompleted, util.AzcopyJobCompletedWithErrors, util.AzcopyJobCompletedWithSkipped, util.AzcopyJobCompletedWithErrorsAndSkipped:
808808
return err
809809
case util.AzcopyJobRunning:
810-
err = wait.PollImmediate(20*time.Second, time.Duration(d.waitForAzCopyTimeoutMinutes)*time.Minute, func() (bool, error) {
810+
err = wait.PollUntilContextTimeout(ctx, 20*time.Second, time.Duration(d.waitForAzCopyTimeoutMinutes)*time.Minute, true, func(context.Context) (bool, error) {
811811
jobState, percent, err := d.azcopy.GetAzcopyJob(dstContainerName, authAzcopyEnv)
812812
klog.V(2).Infof("azcopy job status: %s, copy percent: %s%%, error: %v", jobState, percent, err)
813813
if err != nil {

pkg/blob/controllerserver_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1774,7 +1774,7 @@ func TestCopyVolume(t *testing.T) {
17741774
d.waitForAzCopyTimeoutMinutes = 1
17751775

17761776
err := d.copyVolume(ctx, req, "", "sastoken", nil, "dstContainer", "", &accountOptions, defaultStorageEndPointSuffix)
1777-
if !reflect.DeepEqual(err, wait.ErrWaitTimeout) {
1777+
if !reflect.DeepEqual(err, context.DeadlineExceeded) {
17781778
t.Errorf("Unexpected error: %v", err)
17791779
}
17801780
},

test/e2e/testsuites/testsuites.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ func waitForPersistentVolumeClaimDeleted(ctx context.Context, c clientset.Interf
645645

646646
func pollForStringWorker(namespace string, pod string, command []string, expectedString string, ch chan<- error) {
647647
args := append([]string{"exec", pod, "--"}, command...)
648-
err := wait.PollImmediate(poll, pollForStringTimeout, func() (bool, error) {
648+
err := wait.PollUntilContextTimeout(context.Background(), poll, pollForStringTimeout, true, func(context.Context) (bool, error) {
649649
stdout, err := e2ekubectl.RunKubectl(namespace, args...)
650650
if err != nil {
651651
framework.Logf("Error waiting for output %q in pod %q: %v.", expectedString, pod, err)

0 commit comments

Comments
 (0)