@@ -3622,7 +3622,6 @@ func TestNodeDeletionWithHooks(t *testing.T) {
3622
3622
name string
3623
3623
deletionTimeout * metav1.Duration
3624
3624
resultErr bool
3625
- clusterDeleted bool
3626
3625
expectNodeDeletion bool
3627
3626
expectDeletingReason string
3628
3627
annotations map [string ]string
@@ -3697,13 +3696,8 @@ func TestNodeDeletionWithHooks(t *testing.T) {
3697
3696
reconcileDeleteCache : cache .New [cache.ReconcileEntry ](),
3698
3697
}
3699
3698
3700
- cluster := testCluster .DeepCopy ()
3701
- if tc .clusterDeleted {
3702
- cluster .DeletionTimestamp = & metav1.Time {Time : deletionTime .Add (time .Hour )}
3703
- }
3704
-
3705
3699
s := & scope {
3706
- cluster : cluster ,
3700
+ cluster : & testCluster ,
3707
3701
machine : m ,
3708
3702
infraMachineIsNotFound : true ,
3709
3703
bootstrapConfigIsNotFound : true ,
@@ -3797,7 +3791,6 @@ func TestNodeDeletionWithPreDrainHook(t *testing.T) {
3797
3791
name string
3798
3792
deletionTimeout * metav1.Duration
3799
3793
resultErr bool
3800
- clusterDeleted bool
3801
3794
expectNodeDeletion bool
3802
3795
expectDeletingReason string
3803
3796
pods []* corev1.Pod
@@ -3886,13 +3879,8 @@ func TestNodeDeletionWithPreDrainHook(t *testing.T) {
3886
3879
reconcileDeleteCache : cache .New [cache.ReconcileEntry ](),
3887
3880
}
3888
3881
3889
- cluster := testCluster .DeepCopy ()
3890
- if tc .clusterDeleted {
3891
- cluster .DeletionTimestamp = & metav1.Time {Time : deletionTime .Add (time .Hour )}
3892
- }
3893
-
3894
3882
s := & scope {
3895
- cluster : cluster ,
3883
+ cluster : & testCluster ,
3896
3884
machine : m ,
3897
3885
infraMachineIsNotFound : true ,
3898
3886
bootstrapConfigIsNotFound : true ,
@@ -4055,13 +4043,8 @@ func TestNodeDeletionWithInfraAndBootstrap(t *testing.T) {
4055
4043
reconcileDeleteCache : cache .New [cache.ReconcileEntry ](),
4056
4044
}
4057
4045
4058
- cluster := testCluster .DeepCopy ()
4059
- if tc .clusterDeleted {
4060
- cluster .DeletionTimestamp = & metav1.Time {Time : deletionTime .Add (time .Hour )}
4061
- }
4062
-
4063
4046
s := & scope {
4064
- cluster : cluster ,
4047
+ cluster : & testCluster ,
4065
4048
machine : m ,
4066
4049
infraMachineIsNotFound : tc .infraMachineFound ,
4067
4050
infraMachine : tc .infraMachine ,
@@ -4209,7 +4192,6 @@ func TestNodeDeletionWithVolumeDetach(t *testing.T) {
4209
4192
deletionTimeout * metav1.Duration
4210
4193
resultErr bool
4211
4194
remoteObjects []client.Object
4212
- clusterDeleted bool
4213
4195
expectNodeDeletion bool
4214
4196
expectDeletingReason string
4215
4197
createFakeClient func (... client.Object ) client.Client
@@ -4300,13 +4282,8 @@ func TestNodeDeletionWithVolumeDetach(t *testing.T) {
4300
4282
reconcileDeleteCache : cache .New [cache.ReconcileEntry ](),
4301
4283
}
4302
4284
4303
- cluster := testCluster .DeepCopy ()
4304
- if tc .clusterDeleted {
4305
- cluster .DeletionTimestamp = & metav1.Time {Time : deletionTime .Add (time .Hour )}
4306
- }
4307
-
4308
4285
s := & scope {
4309
- cluster : cluster ,
4286
+ cluster : & testCluster ,
4310
4287
machine : m ,
4311
4288
infraMachineIsNotFound : true ,
4312
4289
bootstrapConfigIsNotFound : true ,
0 commit comments