Skip to content

Commit 8bd716c

Browse files
committed
fix test
1 parent 5ee9279 commit 8bd716c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

internal/controllers/ipaddressclaim_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,18 @@ var _ = Describe("IPAddressClaimReconciler", func() {
9797
)
9898

9999
BeforeEach(func() {
100+
cluster := clusterv1.Cluster{
101+
ObjectMeta: metav1.ObjectMeta{
102+
Name: clusterName,
103+
Namespace: namespace,
104+
},
105+
Spec: clusterv1.ClusterSpec{
106+
Paused: false,
107+
},
108+
}
109+
Expect(k8sClient.Create(context.Background(), &cluster)).To(Succeed())
110+
Eventually(Get(&cluster)).Should(Succeed())
111+
100112
pool := v1alpha2.InClusterIPPool{
101113
ObjectMeta: metav1.ObjectMeta{
102114
Name: poolName,
@@ -115,6 +127,15 @@ var _ = Describe("IPAddressClaimReconciler", func() {
115127
AfterEach(func() {
116128
deleteClaim("test", namespace)
117129
deleteNamespacedPool(poolName, namespace)
130+
131+
cluster := clusterv1.Cluster{
132+
ObjectMeta: metav1.ObjectMeta{
133+
Name: clusterName,
134+
Namespace: namespace,
135+
},
136+
}
137+
ExpectWithOffset(1, k8sClient.Delete(context.Background(), &cluster)).To(Succeed())
138+
EventuallyWithOffset(1, Get(&cluster)).Should(Not(Succeed()))
118139
})
119140

120141
It("should allocate an Address from the Pool", func() {

0 commit comments

Comments
 (0)