@@ -33,12 +33,13 @@ func testHTTPProxyReconcile() {
3333 scm , mgr := setupManager ()
3434
3535 prefix := "test-"
36- Expect (setupReconciler (mgr , scm , reconcilerOptions {
37- prefix : prefix ,
38- defaultIssuerName : "test-issuer" ,
39- defaultIssuerKind : certmanagerv1alpha2 .IssuerKind ,
40- createDNSEndpoint : true ,
41- createCertificate : true ,
36+ Expect (SetupReconciler (mgr , scm , ReconcilerOptions {
37+ ServiceKey : testServiceKey ,
38+ Prefix : prefix ,
39+ DefaultIssuerName : "test-issuer" ,
40+ DefaultIssuerKind : certmanagerv1alpha2 .IssuerKind ,
41+ CreateDNSEndpoint : true ,
42+ CreateCertificate : true ,
4243 })).ShouldNot (HaveOccurred ())
4344
4445 stopMgr := startTestManager (mgr )
@@ -78,11 +79,12 @@ func testHTTPProxyReconcile() {
7879
7980 scm , mgr := setupManager ()
8081
81- Expect (setupReconciler (mgr , scm , reconcilerOptions {
82- defaultIssuerName : "test-issuer" ,
83- defaultIssuerKind : certmanagerv1alpha2 .IssuerKind ,
84- createDNSEndpoint : true ,
85- createCertificate : true ,
82+ Expect (SetupReconciler (mgr , scm , ReconcilerOptions {
83+ ServiceKey : testServiceKey ,
84+ DefaultIssuerName : "test-issuer" ,
85+ DefaultIssuerKind : certmanagerv1alpha2 .IssuerKind ,
86+ CreateDNSEndpoint : true ,
87+ CreateCertificate : true ,
8688 })).ShouldNot (HaveOccurred ())
8789
8890 stopMgr := startTestManager (mgr )
@@ -121,12 +123,13 @@ func testHTTPProxyReconcile() {
121123 scm , mgr := setupManager ()
122124
123125 prefix := "test-"
124- Expect (setupReconciler (mgr , scm , reconcilerOptions {
125- prefix : prefix ,
126- defaultIssuerName : "test-issuer" ,
127- defaultIssuerKind : certmanagerv1alpha2 .IssuerKind ,
128- createDNSEndpoint : true ,
129- createCertificate : true ,
126+ Expect (SetupReconciler (mgr , scm , ReconcilerOptions {
127+ ServiceKey : testServiceKey ,
128+ Prefix : prefix ,
129+ DefaultIssuerName : "test-issuer" ,
130+ DefaultIssuerKind : certmanagerv1alpha2 .IssuerKind ,
131+ CreateDNSEndpoint : true ,
132+ CreateCertificate : true ,
130133 })).ShouldNot (HaveOccurred ())
131134
132135 stopMgr := startTestManager (mgr )
@@ -160,10 +163,11 @@ func testHTTPProxyReconcile() {
160163
161164 By ("setup manager with ClusterIssuer" )
162165 scm , mgr := setupManager ()
163- Expect (setupReconciler (mgr , scm , reconcilerOptions {
164- defaultIssuerName : "test-issuer" ,
165- defaultIssuerKind : certmanagerv1alpha2 .ClusterIssuerKind ,
166- createCertificate : true ,
166+ Expect (SetupReconciler (mgr , scm , ReconcilerOptions {
167+ ServiceKey : testServiceKey ,
168+ DefaultIssuerName : "test-issuer" ,
169+ DefaultIssuerKind : certmanagerv1alpha2 .ClusterIssuerKind ,
170+ CreateCertificate : true ,
167171 })).ShouldNot (HaveOccurred ())
168172
169173 stopMgr := startTestManager (mgr )
@@ -194,10 +198,11 @@ func testHTTPProxyReconcile() {
194198
195199 By ("setup manager" )
196200 scm , mgr := setupManager ()
197- Expect (setupReconciler (mgr , scm , reconcilerOptions {
198- defaultIssuerName : "test-issuer" ,
199- defaultIssuerKind : certmanagerv1alpha2 .IssuerKind ,
200- createCertificate : true ,
201+ Expect (SetupReconciler (mgr , scm , ReconcilerOptions {
202+ ServiceKey : testServiceKey ,
203+ DefaultIssuerName : "test-issuer" ,
204+ DefaultIssuerKind : certmanagerv1alpha2 .IssuerKind ,
205+ CreateCertificate : true ,
201206 })).ShouldNot (HaveOccurred ())
202207
203208 stopMgr := startTestManager (mgr )
@@ -232,10 +237,11 @@ func testHTTPProxyReconcile() {
232237 })
233238 By ("setup manager" )
234239 scm , mgr := setupManager ()
235- Expect (setupReconciler (mgr , scm , reconcilerOptions {
236- defaultIssuerName : "test-issuer" ,
237- defaultIssuerKind : certmanagerv1alpha2 .IssuerKind ,
238- createCertificate : true ,
240+ Expect (SetupReconciler (mgr , scm , ReconcilerOptions {
241+ ServiceKey : testServiceKey ,
242+ DefaultIssuerName : "test-issuer" ,
243+ DefaultIssuerKind : certmanagerv1alpha2 .IssuerKind ,
244+ CreateCertificate : true ,
239245 })).ShouldNot (HaveOccurred ())
240246
241247 stopMgr := startTestManager (mgr )
@@ -273,11 +279,12 @@ func testHTTPProxyReconcile() {
273279 By ("disabling the feature to create Certificate" )
274280 scm , mgr := setupManager ()
275281
276- Expect (setupReconciler (mgr , scm , reconcilerOptions {
277- defaultIssuerName : "test-issuer" ,
278- defaultIssuerKind : certmanagerv1alpha2 .IssuerKind ,
279- createDNSEndpoint : true ,
280- createCertificate : false ,
282+ Expect (SetupReconciler (mgr , scm , ReconcilerOptions {
283+ ServiceKey : testServiceKey ,
284+ DefaultIssuerName : "test-issuer" ,
285+ DefaultIssuerKind : certmanagerv1alpha2 .IssuerKind ,
286+ CreateDNSEndpoint : true ,
287+ CreateCertificate : false ,
281288 })).ShouldNot (HaveOccurred ())
282289
283290 stopMgr := startTestManager (mgr )
@@ -306,7 +313,7 @@ func testHTTPProxyReconcile() {
306313 Expect (crtList .Items ).Should (BeEmpty ())
307314 })
308315
309- It ("should create Certificate, but should not create DNSEndpoint, if `createDNSEndpoint ` is false" , func () {
316+ It ("should create Certificate, but should not create DNSEndpoint, if `CreateDNSEndpoint ` is false" , func () {
310317 ns := testNamespacePrefix + randomString (10 )
311318 Expect (k8sClient .Create (context .Background (), & corev1.Namespace {
312319 ObjectMeta : ctrl.ObjectMeta {Name : ns },
@@ -317,11 +324,12 @@ func testHTTPProxyReconcile() {
317324
318325 By ("disabling the feature to create DNSEndpoint" )
319326 scm , mgr := setupManager ()
320- Expect (setupReconciler (mgr , scm , reconcilerOptions {
321- defaultIssuerName : "test-issuer" ,
322- defaultIssuerKind : certmanagerv1alpha2 .IssuerKind ,
323- createDNSEndpoint : false ,
324- createCertificate : true ,
327+ Expect (SetupReconciler (mgr , scm , ReconcilerOptions {
328+ ServiceKey : testServiceKey ,
329+ DefaultIssuerName : "test-issuer" ,
330+ DefaultIssuerKind : certmanagerv1alpha2 .IssuerKind ,
331+ CreateDNSEndpoint : false ,
332+ CreateCertificate : true ,
325333 })).ShouldNot (HaveOccurred ())
326334
327335 stopMgr := startTestManager (mgr )
@@ -358,11 +366,12 @@ func testHTTPProxyReconcile() {
358366 By ("disabling the feature to create Certificate" )
359367 scm , mgr := setupManager ()
360368
361- Expect (setupReconciler (mgr , scm , reconcilerOptions {
362- defaultIssuerName : "test-issuer" ,
363- defaultIssuerKind : certmanagerv1alpha2 .IssuerKind ,
364- createDNSEndpoint : true ,
365- createCertificate : false ,
369+ Expect (SetupReconciler (mgr , scm , ReconcilerOptions {
370+ ServiceKey : testServiceKey ,
371+ DefaultIssuerName : "test-issuer" ,
372+ DefaultIssuerKind : certmanagerv1alpha2 .IssuerKind ,
373+ CreateDNSEndpoint : true ,
374+ CreateCertificate : false ,
366375 })).ShouldNot (HaveOccurred ())
367376
368377 stopMgr := startTestManager (mgr )
@@ -393,7 +402,7 @@ func testHTTPProxyReconcile() {
393402 Expect (crtList .Items ).Should (BeEmpty ())
394403 })
395404
396- It ("should create Certificate, if `defaultIssuerName ` is empty but 'issuer-name' annotation is not empty" , func () {
405+ It ("should create Certificate, if `DefaultIssuerName ` is empty but 'issuer-name' annotation is not empty" , func () {
397406 ns := testNamespacePrefix + randomString (10 )
398407 Expect (k8sClient .Create (context .Background (), & corev1.Namespace {
399408 ObjectMeta : ctrl.ObjectMeta {Name : ns },
@@ -402,11 +411,12 @@ func testHTTPProxyReconcile() {
402411 ObjectMeta : ctrl.ObjectMeta {Name : ns },
403412 })
404413
405- By ("setup reconciler with empty defaultIssuerName " )
414+ By ("setup reconciler with empty DefaultIssuerName " )
406415 scm , mgr := setupManager ()
407- Expect (setupReconciler (mgr , scm , reconcilerOptions {
408- defaultIssuerKind : certmanagerv1alpha2 .IssuerKind ,
409- createCertificate : true ,
416+ Expect (SetupReconciler (mgr , scm , ReconcilerOptions {
417+ ServiceKey : testServiceKey ,
418+ DefaultIssuerKind : certmanagerv1alpha2 .IssuerKind ,
419+ CreateCertificate : true ,
410420 })).ShouldNot (HaveOccurred ())
411421
412422 stopMgr := startTestManager (mgr )
@@ -427,7 +437,7 @@ func testHTTPProxyReconcile() {
427437 Expect (crt .Spec .IssuerRef .Kind ).Should (Equal (certmanagerv1alpha2 .IssuerKind ))
428438 })
429439
430- It ("should not create Certificate, if `defaultIssuerName ` and 'issuer-name' annotation are empty" , func () {
440+ It ("should not create Certificate, if `DefaultIssuerName ` and 'issuer-name' annotation are empty" , func () {
431441 ns := testNamespacePrefix + randomString (10 )
432442 Expect (k8sClient .Create (context .Background (), & corev1.Namespace {
433443 ObjectMeta : ctrl.ObjectMeta {Name : ns },
@@ -436,11 +446,12 @@ func testHTTPProxyReconcile() {
436446 ObjectMeta : ctrl.ObjectMeta {Name : ns },
437447 })
438448
439- By ("setup reconciler with empty defaultIssuerName " )
449+ By ("setup reconciler with empty DefaultIssuerName " )
440450 scm , mgr := setupManager ()
441- Expect (setupReconciler (mgr , scm , reconcilerOptions {
442- defaultIssuerKind : certmanagerv1alpha2 .IssuerKind ,
443- createCertificate : true ,
451+ Expect (SetupReconciler (mgr , scm , ReconcilerOptions {
452+ ServiceKey : testServiceKey ,
453+ DefaultIssuerKind : certmanagerv1alpha2 .IssuerKind ,
454+ CreateCertificate : true ,
444455 })).ShouldNot (HaveOccurred ())
445456
446457 stopMgr := startTestManager (mgr )
0 commit comments