@@ -3622,7 +3622,6 @@ func TestNodeDeletionWithHooks(t *testing.T) {
36223622 name string
36233623 deletionTimeout * metav1.Duration
36243624 resultErr bool
3625- clusterDeleted bool
36263625 expectNodeDeletion bool
36273626 expectDeletingReason string
36283627 annotations map [string ]string
@@ -3668,7 +3667,7 @@ func TestNodeDeletionWithHooks(t *testing.T) {
36683667 expectNodeDeletion : false ,
36693668 expectDeletingReason : clusterv1 .MachineDeletingDrainingNodeV1Beta2Reason ,
36703669 annotations : map [string ]string {
3671- "machine.cluster.x-k8s.io" : "" ,
3670+ "machine.cluster.x-k8s.io/exclude-wait-for-node-volume-detach " : "" ,
36723671 },
36733672 createFakeClient : func (initObjs ... client.Object ) client.Client {
36743673 return fake .NewClientBuilder ().
@@ -3697,13 +3696,8 @@ func TestNodeDeletionWithHooks(t *testing.T) {
36973696 reconcileDeleteCache : cache .New [cache.ReconcileEntry ](),
36983697 }
36993698
3700- cluster := testCluster .DeepCopy ()
3701- if tc .clusterDeleted {
3702- cluster .DeletionTimestamp = & metav1.Time {Time : deletionTime .Add (time .Hour )}
3703- }
3704-
37053699 s := & scope {
3706- cluster : cluster ,
3700+ cluster : & testCluster ,
37073701 machine : m ,
37083702 infraMachineIsNotFound : true ,
37093703 bootstrapConfigIsNotFound : true ,
@@ -3797,7 +3791,6 @@ func TestNodeDeletionWithPreDrainHook(t *testing.T) {
37973791 name string
37983792 deletionTimeout * metav1.Duration
37993793 resultErr bool
3800- clusterDeleted bool
38013794 expectNodeDeletion bool
38023795 expectDeletingReason string
38033796 pods []* corev1.Pod
@@ -3886,13 +3879,8 @@ func TestNodeDeletionWithPreDrainHook(t *testing.T) {
38863879 reconcileDeleteCache : cache .New [cache.ReconcileEntry ](),
38873880 }
38883881
3889- cluster := testCluster .DeepCopy ()
3890- if tc .clusterDeleted {
3891- cluster .DeletionTimestamp = & metav1.Time {Time : deletionTime .Add (time .Hour )}
3892- }
3893-
38943882 s := & scope {
3895- cluster : cluster ,
3883+ cluster : & testCluster ,
38963884 machine : m ,
38973885 infraMachineIsNotFound : true ,
38983886 bootstrapConfigIsNotFound : true ,
@@ -4055,13 +4043,8 @@ func TestNodeDeletionWithInfraAndBootstrap(t *testing.T) {
40554043 reconcileDeleteCache : cache .New [cache.ReconcileEntry ](),
40564044 }
40574045
4058- cluster := testCluster .DeepCopy ()
4059- if tc .clusterDeleted {
4060- cluster .DeletionTimestamp = & metav1.Time {Time : deletionTime .Add (time .Hour )}
4061- }
4062-
40634046 s := & scope {
4064- cluster : cluster ,
4047+ cluster : & testCluster ,
40654048 machine : m ,
40664049 infraMachineIsNotFound : tc .infraMachineFound ,
40674050 infraMachine : tc .infraMachine ,
@@ -4209,7 +4192,6 @@ func TestNodeDeletionWithVolumeDetach(t *testing.T) {
42094192 deletionTimeout * metav1.Duration
42104193 resultErr bool
42114194 remoteObjects []client.Object
4212- clusterDeleted bool
42134195 expectNodeDeletion bool
42144196 expectDeletingReason string
42154197 createFakeClient func (... client.Object ) client.Client
@@ -4300,13 +4282,8 @@ func TestNodeDeletionWithVolumeDetach(t *testing.T) {
43004282 reconcileDeleteCache : cache .New [cache.ReconcileEntry ](),
43014283 }
43024284
4303- cluster := testCluster .DeepCopy ()
4304- if tc .clusterDeleted {
4305- cluster .DeletionTimestamp = & metav1.Time {Time : deletionTime .Add (time .Hour )}
4306- }
4307-
43084285 s := & scope {
4309- cluster : cluster ,
4286+ cluster : & testCluster ,
43104287 machine : m ,
43114288 infraMachineIsNotFound : true ,
43124289 bootstrapConfigIsNotFound : true ,
0 commit comments