@@ -1554,6 +1554,9 @@ func TestKubeadmControlPlaneReconciler_syncMachines(t *testing.T) {
1554
1554
Bootstrap : clusterv1.Bootstrap {
1555
1555
DataSecretName : ptr .To ("machine-bootstrap-secret" ),
1556
1556
},
1557
+ NodeDrainTimeout : duration5s ,
1558
+ NodeVolumeDetachTimeout : duration5s ,
1559
+ NodeDeletionTimeout : duration5s ,
1557
1560
},
1558
1561
}
1559
1562
g .Expect (env .Create (ctx , deletingMachine , client .FieldOwner (classicManager ))).To (Succeed ())
@@ -1636,16 +1639,16 @@ func TestKubeadmControlPlaneReconciler_syncMachines(t *testing.T) {
1636
1639
KCP : kcp ,
1637
1640
Cluster : testCluster ,
1638
1641
Machines : collections.Machines {
1639
- inPlaceMutatingMachine .Name : inPlaceMutatingMachine ,
1640
- deletingMachine .Name : deletingMachine ,
1641
- nilInfraMachineMachine .Name : nilInfraMachineMachine ,
1642
+ inPlaceMutatingMachine .Name : inPlaceMutatingMachine . DeepCopy () ,
1643
+ deletingMachine .Name : deletingMachine . DeepCopy () ,
1644
+ nilInfraMachineMachine .Name : nilInfraMachineMachine . DeepCopy () ,
1642
1645
},
1643
1646
KubeadmConfigs : map [string ]* bootstrapv1.KubeadmConfig {
1644
- inPlaceMutatingMachine .Name : existingKubeadmConfig ,
1647
+ inPlaceMutatingMachine .Name : existingKubeadmConfig . DeepCopy () ,
1645
1648
deletingMachine .Name : nil ,
1646
1649
},
1647
1650
InfraResources : map [string ]* unstructured.Unstructured {
1648
- inPlaceMutatingMachine .Name : existingInfraMachine ,
1651
+ inPlaceMutatingMachine .Name : existingInfraMachine . DeepCopy () ,
1649
1652
deletingMachine .Name : nil ,
1650
1653
},
1651
1654
}
@@ -1806,7 +1809,14 @@ func TestKubeadmControlPlaneReconciler_syncMachines(t *testing.T) {
1806
1809
// Verify the machine labels and annotations are unchanged.
1807
1810
g .Expect (updatedDeletingMachine .Labels ).Should (Equal (deletingMachine .Labels ))
1808
1811
g .Expect (updatedDeletingMachine .Annotations ).Should (Equal (deletingMachine .Annotations ))
1809
- // Verify the machine spec is unchanged.
1812
+ // Verify Node timeout values
1813
+ g .Expect (updatedDeletingMachine .Spec .NodeDrainTimeout ).Should (Equal (kcp .Spec .MachineTemplate .NodeDrainTimeout ))
1814
+ g .Expect (updatedDeletingMachine .Spec .NodeDeletionTimeout ).Should (Equal (kcp .Spec .MachineTemplate .NodeDeletionTimeout ))
1815
+ g .Expect (updatedDeletingMachine .Spec .NodeVolumeDetachTimeout ).Should (Equal (kcp .Spec .MachineTemplate .NodeVolumeDetachTimeout ))
1816
+ // Verify the machine spec is otherwise unchanged.
1817
+ deletingMachine .Spec .NodeDrainTimeout = kcp .Spec .MachineTemplate .NodeDrainTimeout
1818
+ deletingMachine .Spec .NodeDeletionTimeout = kcp .Spec .MachineTemplate .NodeDeletionTimeout
1819
+ deletingMachine .Spec .NodeVolumeDetachTimeout = kcp .Spec .MachineTemplate .NodeVolumeDetachTimeout
1810
1820
g .Expect (updatedDeletingMachine .Spec ).Should (BeComparableTo (deletingMachine .Spec ))
1811
1821
}
1812
1822
0 commit comments