Skip to content

Commit 43b39a0

Browse files
committed
address review comments
1 parent fc4ae67 commit 43b39a0

File tree

1 file changed

+4
-27
lines changed

1 file changed

+4
-27
lines changed

internal/controllers/machine/machine_controller_test.go

+4-27
Original file line numberDiff line numberDiff line change
@@ -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
@@ -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

Comments
 (0)