@@ -491,7 +491,7 @@ var _ = SIGDescribe("Garbage collector", func() {
491
491
}
492
492
// wait for deployment to create some rs
493
493
ginkgo .By ("Wait for the Deployment to create new ReplicaSet" )
494
- err = wait .PollImmediateWithContext (ctx , 500 * time .Millisecond , 1 * time .Minute , func (ctx context.Context ) (bool , error ) {
494
+ err = wait .PollUntilContextTimeout (ctx , 500 * time .Millisecond , 1 * time .Minute , true , func (ctx context.Context ) (bool , error ) {
495
495
rsList , err := rsClient .List (ctx , metav1.ListOptions {})
496
496
if err != nil {
497
497
return false , fmt .Errorf ("failed to list rs: %w" , err )
@@ -510,7 +510,7 @@ var _ = SIGDescribe("Garbage collector", func() {
510
510
framework .Failf ("failed to delete the deployment: %v" , err )
511
511
}
512
512
ginkgo .By ("wait for all rs to be garbage collected" )
513
- err = wait .PollImmediateWithContext (ctx , 500 * time .Millisecond , 1 * time .Minute + gcInformerResyncRetryTimeout , func (ctx context.Context ) (bool , error ) {
513
+ err = wait .PollUntilContextTimeout (ctx , 500 * time .Millisecond , 1 * time .Minute + gcInformerResyncRetryTimeout , true , func (ctx context.Context ) (bool , error ) {
514
514
objects := map [string ]int {"Deployments" : 0 , "ReplicaSets" : 0 , "Pods" : 0 }
515
515
return verifyRemainingObjects (ctx , f , objects )
516
516
})
@@ -551,7 +551,7 @@ var _ = SIGDescribe("Garbage collector", func() {
551
551
// wait for deployment to create some rs
552
552
ginkgo .By ("Wait for the Deployment to create new ReplicaSet" )
553
553
var replicaset appsv1.ReplicaSet
554
- err = wait .PollImmediateWithContext (ctx , 500 * time .Millisecond , 1 * time .Minute , func (ctx context.Context ) (bool , error ) {
554
+ err = wait .PollUntilContextTimeout (ctx , 500 * time .Millisecond , 1 * time .Minute , true , func (ctx context.Context ) (bool , error ) {
555
555
rsList , err := rsClient .List (ctx , metav1.ListOptions {})
556
556
if err != nil {
557
557
return false , fmt .Errorf ("failed to list rs: %w" , err )
@@ -568,7 +568,7 @@ var _ = SIGDescribe("Garbage collector", func() {
568
568
}
569
569
570
570
desiredGeneration := replicaset .Generation
571
- if err := wait .PollImmediateWithContext (ctx , 100 * time .Millisecond , 60 * time .Second , func (ctx context.Context ) (bool , error ) {
571
+ if err := wait .PollUntilContextTimeout (ctx , 100 * time .Millisecond , 60 * time .Second , true , func (ctx context.Context ) (bool , error ) {
572
572
newRS , err := clientSet .AppsV1 ().ReplicaSets (replicaset .Namespace ).Get (ctx , replicaset .Name , metav1.GetOptions {})
573
573
if err != nil {
574
574
return false , err
@@ -585,7 +585,7 @@ var _ = SIGDescribe("Garbage collector", func() {
585
585
framework .Failf ("failed to delete the deployment: %v" , err )
586
586
}
587
587
ginkgo .By ("wait for deployment deletion to see if the garbage collector mistakenly deletes the rs" )
588
- err = wait .PollImmediateWithContext (ctx , 500 * time .Millisecond , 1 * time .Minute + gcInformerResyncRetryTimeout , func (ctx context.Context ) (bool , error ) {
588
+ err = wait .PollUntilContextTimeout (ctx , 500 * time .Millisecond , 1 * time .Minute + gcInformerResyncRetryTimeout , true , func (ctx context.Context ) (bool , error ) {
589
589
dList , err := deployClient .List (ctx , metav1.ListOptions {})
590
590
if err != nil {
591
591
return false , fmt .Errorf ("failed to list deployments: %w" , err )
@@ -974,7 +974,7 @@ var _ = SIGDescribe("Garbage collector", func() {
974
974
}
975
975
// Wait for the canary foreground finalization to complete, which means GC is aware of our new custom resource type
976
976
var lastCanary * unstructured.Unstructured
977
- if err := wait .PollImmediateWithContext (ctx , 5 * time .Second , 3 * time .Minute , func (ctx context.Context ) (bool , error ) {
977
+ if err := wait .PollUntilContextTimeout (ctx , 5 * time .Second , 3 * time .Minute , true , func (ctx context.Context ) (bool , error ) {
978
978
lastCanary , err = resourceClient .Get (ctx , dependentName , metav1.GetOptions {})
979
979
return apierrors .IsNotFound (err ), nil
980
980
}); err != nil {
@@ -1119,7 +1119,7 @@ var _ = SIGDescribe("Garbage collector", func() {
1119
1119
framework .ExpectNoError (err , "failed to create cronjob: %+v, in namespace: %s" , cronJob , f .Namespace .Name )
1120
1120
1121
1121
ginkgo .By ("Wait for the CronJob to create new Job" )
1122
- err = wait .PollImmediateWithContext (ctx , 500 * time .Millisecond , 2 * time .Minute , func (ctx context.Context ) (bool , error ) {
1122
+ err = wait .PollUntilContextTimeout (ctx , 500 * time .Millisecond , 2 * time .Minute , true , func (ctx context.Context ) (bool , error ) {
1123
1123
jobs , err := f .ClientSet .BatchV1 ().Jobs (f .Namespace .Name ).List (ctx , metav1.ListOptions {})
1124
1124
if err != nil {
1125
1125
return false , fmt .Errorf ("failed to list jobs: %w" , err )
@@ -1135,7 +1135,7 @@ var _ = SIGDescribe("Garbage collector", func() {
1135
1135
framework .Failf ("Failed to delete the CronJob: %v" , err )
1136
1136
}
1137
1137
ginkgo .By ("Verify if cronjob does not leave jobs nor pods behind" )
1138
- err = wait .PollImmediateWithContext (ctx , 500 * time .Millisecond , 1 * time .Minute , func (ctx context.Context ) (bool , error ) {
1138
+ err = wait .PollUntilContextTimeout (ctx , 500 * time .Millisecond , 1 * time .Minute , true , func (ctx context.Context ) (bool , error ) {
1139
1139
objects := map [string ]int {"CronJobs" : 0 , "Jobs" : 0 , "Pods" : 0 }
1140
1140
return verifyRemainingObjects (ctx , f , objects )
1141
1141
})
0 commit comments