Skip to content

Commit

Permalink
Merge pull request #11044 from vincepri/followup-11032
Browse files Browse the repository at this point in the history
🌱 Follow-up PR nits from 11032
  • Loading branch information
k8s-ci-robot authored Aug 12, 2024
2 parents 044dca2 + 6462c22 commit 4a9fd9d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions internal/controllers/machine/machine_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2547,6 +2547,7 @@ func TestNodeDeletionWithoutNodeRefFallback(t *testing.T) {
Namespace: metav1.NamespaceDefault,
Labels: map[string]string{
clusterv1.MachineControlPlaneLabel: "",
clusterv1.ClusterNameLabel: "test-cluster",
},
Annotations: map[string]string{
"machine.cluster.x-k8s.io/exclude-node-draining": "",
Expand Down Expand Up @@ -2592,7 +2593,6 @@ func TestNodeDeletionWithoutNodeRefFallback(t *testing.T) {
name string
deletionTimeout *metav1.Duration
resultErr bool
clusterDeleted bool
expectNodeDeletion bool
createFakeClient func(...client.Object) client.Client
}{
Expand Down Expand Up @@ -2627,10 +2627,6 @@ func TestNodeDeletionWithoutNodeRefFallback(t *testing.T) {
}

cluster := testCluster.DeepCopy()
if tc.clusterDeleted {
cluster.DeletionTimestamp = &metav1.Time{Time: deletionTime.Add(time.Hour)}
}

_, err := r.reconcileDelete(context.Background(), cluster, m)

if tc.resultErr {
Expand All @@ -2639,7 +2635,7 @@ func TestNodeDeletionWithoutNodeRefFallback(t *testing.T) {
g.Expect(err).ToNot(HaveOccurred())
if tc.expectNodeDeletion {
n := &corev1.Node{}
g.Expect(fakeClient.Get(context.Background(), client.ObjectKeyFromObject(node), n)).NotTo(Succeed())
g.Expect(apierrors.IsNotFound(fakeClient.Get(context.Background(), client.ObjectKeyFromObject(node), n))).To(BeTrue())
}
}
})
Expand Down

0 comments on commit 4a9fd9d

Please sign in to comment.