@@ -827,8 +827,6 @@ func TestReconcileRequest(t *testing.T) {
827
827
},
828
828
}
829
829
830
- time := metav1 .Now ()
831
-
832
830
testCluster := clusterv1.Cluster {
833
831
ObjectMeta : metav1.ObjectMeta {
834
832
Name : "test-cluster" ,
@@ -922,7 +920,7 @@ func TestReconcileRequest(t *testing.T) {
922
920
clusterv1 .MachineControlPlaneLabel : "" ,
923
921
},
924
922
Finalizers : []string {clusterv1 .MachineFinalizer },
925
- DeletionTimestamp : & time ,
923
+ DeletionTimestamp : ptr . To ( metav1 . Now ()) ,
926
924
},
927
925
Spec : clusterv1.MachineSpec {
928
926
ClusterName : "test-cluster" ,
@@ -958,7 +956,7 @@ func TestReconcileRequest(t *testing.T) {
958
956
Client : clientFake ,
959
957
ClusterCache : clustercache .NewFakeClusterCache (clientFake , client.ObjectKey {Name : testCluster .Name , Namespace : testCluster .Namespace }),
960
958
recorder : record .NewFakeRecorder (10 ),
961
- reconcileDeleteCache : cache .New [cache.ReconcileEntry ](),
959
+ reconcileDeleteCache : cache.New [cache.ReconcileEntry ](cache . DefaultTTL ),
962
960
externalTracker : external.ObjectTracker {
963
961
Controller : externalfake.Controller {},
964
962
Cache : & informertest.FakeInformers {},
@@ -1314,7 +1312,7 @@ func TestRemoveMachineFinalizerAfterDeleteReconcile(t *testing.T) {
1314
1312
mr := & Reconciler {
1315
1313
Client : c ,
1316
1314
ClusterCache : clustercache .NewFakeClusterCache (c , client .ObjectKeyFromObject (testCluster )),
1317
- reconcileDeleteCache : cache .New [cache.ReconcileEntry ](),
1315
+ reconcileDeleteCache : cache.New [cache.ReconcileEntry ](cache . DefaultTTL ),
1318
1316
}
1319
1317
_ , err := mr .Reconcile (ctx , reconcile.Request {NamespacedName : key })
1320
1318
g .Expect (err ).ToNot (HaveOccurred ())
@@ -1709,7 +1707,7 @@ func TestDrainNode(t *testing.T) {
1709
1707
r := & Reconciler {
1710
1708
Client : c ,
1711
1709
ClusterCache : clustercache .NewFakeClusterCache (remoteClient , client .ObjectKeyFromObject (testCluster )),
1712
- reconcileDeleteCache : cache .New [cache.ReconcileEntry ](),
1710
+ reconcileDeleteCache : cache.New [cache.ReconcileEntry ](cache . DefaultTTL ),
1713
1711
}
1714
1712
1715
1713
testMachine .Status .NodeRef = & corev1.ObjectReference {
@@ -1840,7 +1838,7 @@ func TestDrainNode_withCaching(t *testing.T) {
1840
1838
WithObjects (remoteObjs ... ).
1841
1839
Build ()
1842
1840
1843
- reconcileDeleteCache := cache .New [cache.ReconcileEntry ]()
1841
+ reconcileDeleteCache := cache.New [cache.ReconcileEntry ](cache . DefaultTTL )
1844
1842
r := & Reconciler {
1845
1843
Client : c ,
1846
1844
ClusterCache : clustercache .NewFakeClusterCache (remoteClient , client .ObjectKeyFromObject (testCluster )),
@@ -2498,7 +2496,7 @@ func TestShouldWaitForNodeVolumes(t *testing.T) {
2498
2496
r := & Reconciler {
2499
2497
Client : fakeClient ,
2500
2498
ClusterCache : clustercache .NewFakeClusterCache (remoteFakeClient , client .ObjectKeyFromObject (testCluster )),
2501
- reconcileDeleteCache : cache .New [cache.ReconcileEntry ](),
2499
+ reconcileDeleteCache : cache.New [cache.ReconcileEntry ](cache . DefaultTTL ),
2502
2500
}
2503
2501
2504
2502
testMachine .Status .NodeRef = & corev1.ObjectReference {
@@ -3335,7 +3333,7 @@ func TestNodeDeletion(t *testing.T) {
3335
3333
ClusterCache : clustercache .NewFakeClusterCache (fakeClient , client .ObjectKeyFromObject (& testCluster )),
3336
3334
recorder : record .NewFakeRecorder (10 ),
3337
3335
nodeDeletionRetryTimeout : 10 * time .Millisecond ,
3338
- reconcileDeleteCache : cache .New [cache.ReconcileEntry ](),
3336
+ reconcileDeleteCache : cache.New [cache.ReconcileEntry ](cache . DefaultTTL ),
3339
3337
}
3340
3338
3341
3339
cluster := testCluster .DeepCopy ()
@@ -3469,7 +3467,7 @@ func TestNodeDeletionWithoutNodeRefFallback(t *testing.T) {
3469
3467
ClusterCache : clustercache .NewFakeClusterCache (fakeClient , client .ObjectKeyFromObject (& testCluster )),
3470
3468
recorder : record .NewFakeRecorder (10 ),
3471
3469
nodeDeletionRetryTimeout : 10 * time .Millisecond ,
3472
- reconcileDeleteCache : cache .New [cache.ReconcileEntry ](),
3470
+ reconcileDeleteCache : cache.New [cache.ReconcileEntry ](cache . DefaultTTL ),
3473
3471
}
3474
3472
3475
3473
s := & scope {
0 commit comments