@@ -29,6 +29,8 @@ import (
2929 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3030 operatorv1 "sigs.k8s.io/cluster-api-operator/api/v1alpha1"
3131 "sigs.k8s.io/cluster-api/test/framework"
32+
33+ operatorframework "sigs.k8s.io/cluster-api-operator/test/framework"
3234 "sigs.k8s.io/controller-runtime/pkg/client"
3335)
3436
@@ -65,7 +67,7 @@ var _ = Describe("Create and delete a provider with manifests that don't fit the
6567 }, e2eConfig .GetIntervals (bootstrapClusterProxy .GetName (), "wait-controllers" )... )
6668
6769 By ("Waiting for core provider to be ready" )
68- WaitForConditional (ctx , ObjectConditionalInput {
70+ operatorframework . WaitForConditional (ctx , operatorframework. ObjectConditionalInput {
6971 Reader : k8sclient ,
7072 Object : coreProvider ,
7173 Conditional : func () bool {
@@ -76,16 +78,16 @@ var _ = Describe("Create and delete a provider with manifests that don't fit the
7678 }
7779 return false
7880 },
79- }, timeout )
81+ }, e2eConfig . GetIntervals ( bootstrapClusterProxy . GetName (), "wait-controllers" ) ... )
8082
8183 By ("Waiting for status.IntalledVersion to be set" )
82- WaitForConditional (ctx , ObjectConditionalInput {
84+ operatorframework . WaitForConditional (ctx , operatorframework. ObjectConditionalInput {
8385 Reader : k8sclient ,
8486 Object : coreProvider ,
8587 Conditional : func () bool {
8688 return coreProvider .Status .InstalledVersion != nil && * coreProvider .Status .InstalledVersion == coreProvider .Spec .Version
8789 },
88- }, timeout )
90+ }, e2eConfig . GetIntervals ( bootstrapClusterProxy . GetName (), "wait-controllers" ) ... )
8991 })
9092
9193 It ("should successfully create and delete an InfrastructureProvider for OCI" , func () {
@@ -105,7 +107,7 @@ var _ = Describe("Create and delete a provider with manifests that don't fit the
105107 Expect (k8sclient .Create (ctx , infraProvider )).To (Succeed ())
106108
107109 By ("Waiting for the infrastructure provider to be ready" )
108- WaitForConditional (ctx , ObjectConditionalInput {
110+ operatorframework . WaitForConditional (ctx , operatorframework. ObjectConditionalInput {
109111 Reader : k8sclient ,
110112 Object : infraProvider ,
111113 Conditional : func () bool {
@@ -116,16 +118,16 @@ var _ = Describe("Create and delete a provider with manifests that don't fit the
116118 }
117119 return false
118120 },
119- }, timeout )
121+ }, e2eConfig . GetIntervals ( bootstrapClusterProxy . GetName (), "wait-controllers" ) ... )
120122
121123 By ("Waiting for status.IntalledVersion to be set" )
122- WaitForConditional (ctx , ObjectConditionalInput {
124+ operatorframework . WaitForConditional (ctx , operatorframework. ObjectConditionalInput {
123125 Reader : k8sclient ,
124126 Object : infraProvider ,
125127 Conditional : func () bool {
126128 return infraProvider .Status .InstalledVersion != nil && * infraProvider .Status .InstalledVersion == infraProvider .Spec .Version
127129 },
128- }, timeout )
130+ }, e2eConfig . GetIntervals ( bootstrapClusterProxy . GetName (), "wait-controllers" ) ... )
129131
130132 By ("Ensure that the created config map has correct annotation" )
131133 cmName := fmt .Sprintf ("infrastructure-%s-%s" , ociInfrastructureProviderName , ociInfrastructureProviderVersion )
@@ -148,26 +150,26 @@ var _ = Describe("Create and delete a provider with manifests that don't fit the
148150 By ("Waiting for the infrastructure provider deployment to be created" )
149151 Eventually (func () bool {
150152 return k8sclient .Get (ctx , client .ObjectKeyFromObject (deployment ), deployment ) == nil
151- }, timeout )
153+ }, e2eConfig . GetIntervals ( bootstrapClusterProxy . GetName (), "wait-controllers" ) ... )
152154
153155 Expect (k8sclient .Delete (ctx , infraProvider )).To (Succeed ())
154156
155157 By ("Waiting for the infrastructure provider deployment to be deleted" )
156- WaitForDelete (ctx , ObjectGetterInput {
158+ operatorframework . WaitForDelete (ctx , operatorframework. ObjectGetterInput {
157159 Reader : k8sclient ,
158160 Object : deployment ,
159- }, timeout )
161+ }, e2eConfig . GetIntervals ( bootstrapClusterProxy . GetName (), "wait-controllers" ) ... )
160162
161163 By ("Waiting for the configmap to be deleted" )
162- WaitForDelete (ctx , ObjectGetterInput {
164+ operatorframework . WaitForDelete (ctx , operatorframework. ObjectGetterInput {
163165 Reader : k8sclient ,
164166 Object : & corev1.ConfigMap {
165167 ObjectMeta : metav1.ObjectMeta {
166168 Namespace : operatorNamespace ,
167169 Name : cmName ,
168170 },
169171 },
170- }, timeout )
172+ }, e2eConfig . GetIntervals ( bootstrapClusterProxy . GetName (), "wait-controllers" ) ... )
171173 })
172174
173175 It ("should successfully create and delete an InfrastructureProvider for OCI with custom name from a pre-created ConfigMap" , func () {
@@ -201,7 +203,7 @@ var _ = Describe("Create and delete a provider with manifests that don't fit the
201203 Expect (k8sclient .Create (ctx , infraProvider )).To (Succeed ())
202204
203205 By ("Waiting for the infrastructure provider to be ready" )
204- WaitForConditional (ctx , ObjectConditionalInput {
206+ operatorframework . WaitForConditional (ctx , operatorframework. ObjectConditionalInput {
205207 Reader : k8sclient ,
206208 Object : infraProvider ,
207209 Conditional : func () bool {
@@ -212,16 +214,16 @@ var _ = Describe("Create and delete a provider with manifests that don't fit the
212214 }
213215 return false
214216 },
215- }, timeout )
217+ }, e2eConfig . GetIntervals ( bootstrapClusterProxy . GetName (), "wait-controllers" ) ... )
216218
217219 By ("Waiting for status.IntalledVersion to be set" )
218- WaitForConditional (ctx , ObjectConditionalInput {
220+ operatorframework . WaitForConditional (ctx , operatorframework. ObjectConditionalInput {
219221 Reader : k8sclient ,
220222 Object : infraProvider ,
221223 Conditional : func () bool {
222224 return infraProvider .Status .InstalledVersion != nil && * infraProvider .Status .InstalledVersion == infraProvider .Spec .Version
223225 },
224- }, timeout )
226+ }, e2eConfig . GetIntervals ( bootstrapClusterProxy . GetName (), "wait-controllers" ) ... )
225227
226228 By ("Ensure that the created config map has correct annotation" )
227229 cm := & corev1.ConfigMap {}
@@ -243,15 +245,15 @@ var _ = Describe("Create and delete a provider with manifests that don't fit the
243245 By ("Waiting for the infrastructure provider deployment to be created" )
244246 Eventually (func () bool {
245247 return k8sclient .Get (ctx , client .ObjectKeyFromObject (deployment ), deployment ) == nil
246- }, timeout )
248+ }, e2eConfig . GetIntervals ( bootstrapClusterProxy . GetName (), "wait-controllers" ) ... )
247249
248250 Expect (k8sclient .Delete (ctx , infraProvider )).To (Succeed ())
249251
250252 By ("Waiting for the infrastructure provider deployment to be deleted" )
251- WaitForDelete (ctx , ObjectGetterInput {
253+ operatorframework . WaitForDelete (ctx , operatorframework. ObjectGetterInput {
252254 Reader : k8sclient ,
253255 Object : deployment ,
254- }, timeout )
256+ }, e2eConfig . GetIntervals ( bootstrapClusterProxy . GetName (), "wait-controllers" ) ... )
255257 })
256258
257259 It ("should successfully delete a CoreProvider" , func () {
@@ -269,20 +271,20 @@ var _ = Describe("Create and delete a provider with manifests that don't fit the
269271 Expect (k8sclient .Delete (ctx , coreProvider )).To (Succeed ())
270272
271273 By ("Waiting for the core provider deployment to be deleted" )
272- WaitForDelete (ctx , ObjectGetterInput {
274+ operatorframework . WaitForDelete (ctx , operatorframework. ObjectGetterInput {
273275 Reader : k8sclient ,
274276 Object : & appsv1.Deployment {
275277 ObjectMeta : metav1.ObjectMeta {
276278 Name : coreProviderDeploymentName ,
277279 Namespace : operatorNamespace ,
278280 },
279281 },
280- }, timeout )
282+ }, e2eConfig . GetIntervals ( bootstrapClusterProxy . GetName (), "wait-controllers" ) ... )
281283
282284 By ("Waiting for the core provider object to be deleted" )
283- WaitForDelete (ctx , ObjectGetterInput {
285+ operatorframework . WaitForDelete (ctx , operatorframework. ObjectGetterInput {
284286 Reader : k8sclient ,
285287 Object : coreProvider ,
286- }, timeout )
288+ }, e2eConfig . GetIntervals ( bootstrapClusterProxy . GetName (), "wait-controllers" ) ... )
287289 })
288290})
0 commit comments