@@ -117,8 +117,10 @@ func TestCertificateSigningRequestReconcilerReconcile(t *testing.T) {
117117 )
118118
119119 successSigner := func (cert string ) signer.Sign {
120- return func (_ context.Context , _ signer.CertificateRequestObject , _ v1alpha1.Issuer ) ([]byte , error ) {
121- return []byte (cert ), nil
120+ return func (_ context.Context , _ signer.CertificateRequestObject , _ v1alpha1.Issuer ) (signer.PEMBundle , error ) {
121+ return signer.PEMBundle {
122+ ChainPEM : []byte (cert ),
123+ }, nil
122124 }
123125 }
124126
@@ -287,8 +289,8 @@ func TestCertificateSigningRequestReconcilerReconcile(t *testing.T) {
287289 // condition to Failed.
288290 {
289291 name : "timeout-permanent-error" ,
290- sign : func (_ context.Context , cr signer.CertificateRequestObject , _ v1alpha1.Issuer ) ([] byte , error ) {
291- return nil , fmt .Errorf ("a specific error" )
292+ sign : func (_ context.Context , cr signer.CertificateRequestObject , _ v1alpha1.Issuer ) (signer. PEMBundle , error ) {
293+ return signer. PEMBundle {} , fmt .Errorf ("a specific error" )
292294 },
293295 objects : []client.Object {
294296 cmgen .CertificateSigningRequestFrom (cr1 ,
@@ -322,8 +324,8 @@ func TestCertificateSigningRequestReconcilerReconcile(t *testing.T) {
322324 // the MaxRetryDuration has been exceeded).
323325 {
324326 name : "retry-on-pending-error" ,
325- sign : func (_ context.Context , cr signer.CertificateRequestObject , _ v1alpha1.Issuer ) ([] byte , error ) {
326- return nil , signer.PendingError {Err : fmt .Errorf ("pending error" )}
327+ sign : func (_ context.Context , cr signer.CertificateRequestObject , _ v1alpha1.Issuer ) (signer. PEMBundle , error ) {
328+ return signer. PEMBundle {} , signer.PendingError {Err : fmt .Errorf ("pending error" )}
327329 },
328330 objects : []client.Object {
329331 cmgen .CertificateSigningRequestFrom (cr1 ,
@@ -357,8 +359,8 @@ func TestCertificateSigningRequestReconcilerReconcile(t *testing.T) {
357359 // condition to *Pending*.
358360 {
359361 name : "error-set-certificate-request-condition-should-add-new-condition-and-retry" ,
360- sign : func (_ context.Context , cr signer.CertificateRequestObject , _ v1alpha1.Issuer ) ([] byte , error ) {
361- return nil , signer.SetCertificateRequestConditionError {
362+ sign : func (_ context.Context , cr signer.CertificateRequestObject , _ v1alpha1.Issuer ) (signer. PEMBundle , error ) {
363+ return signer. PEMBundle {} , signer.SetCertificateRequestConditionError {
362364 Err : fmt .Errorf ("test error" ),
363365 ConditionType : "[condition type]" ,
364366 Status : cmmeta .ConditionTrue ,
@@ -404,8 +406,8 @@ func TestCertificateSigningRequestReconcilerReconcile(t *testing.T) {
404406 // condition to *Pending*.
405407 {
406408 name : "error-set-certificate-request-condition-should-update-existing-condition-and-retry" ,
407- sign : func (_ context.Context , cr signer.CertificateRequestObject , _ v1alpha1.Issuer ) ([] byte , error ) {
408- return nil , signer.SetCertificateRequestConditionError {
409+ sign : func (_ context.Context , cr signer.CertificateRequestObject , _ v1alpha1.Issuer ) (signer. PEMBundle , error ) {
410+ return signer. PEMBundle {} , signer.SetCertificateRequestConditionError {
409411 Err : fmt .Errorf ("test error2" ),
410412 ConditionType : "[condition type]" ,
411413 Status : cmmeta .ConditionTrue ,
@@ -461,8 +463,8 @@ func TestCertificateSigningRequestReconcilerReconcile(t *testing.T) {
461463 // to *Failed*.
462464 {
463465 name : "error-set-certificate-request-condition-should-add-new-condition-and-timeout" ,
464- sign : func (_ context.Context , cr signer.CertificateRequestObject , _ v1alpha1.Issuer ) ([] byte , error ) {
465- return nil , signer.SetCertificateRequestConditionError {
466+ sign : func (_ context.Context , cr signer.CertificateRequestObject , _ v1alpha1.Issuer ) (signer. PEMBundle , error ) {
467+ return signer. PEMBundle {} , signer.SetCertificateRequestConditionError {
466468 Err : fmt .Errorf ("test error" ),
467469 ConditionType : "[condition type]" ,
468470 Status : cmmeta .ConditionTrue ,
@@ -516,8 +518,8 @@ func TestCertificateSigningRequestReconcilerReconcile(t *testing.T) {
516518 // to *Failed*.
517519 {
518520 name : "error-set-certificate-request-condition-should-update-existing-condition-and-timeout" ,
519- sign : func (_ context.Context , cr signer.CertificateRequestObject , _ v1alpha1.Issuer ) ([] byte , error ) {
520- return nil , signer.SetCertificateRequestConditionError {
521+ sign : func (_ context.Context , cr signer.CertificateRequestObject , _ v1alpha1.Issuer ) (signer. PEMBundle , error ) {
522+ return signer. PEMBundle {} , signer.SetCertificateRequestConditionError {
521523 Err : fmt .Errorf ("test error2" ),
522524 ConditionType : "[condition type]" ,
523525 Status : cmmeta .ConditionTrue ,
@@ -577,8 +579,8 @@ func TestCertificateSigningRequestReconcilerReconcile(t *testing.T) {
577579 // exceeded).
578580 {
579581 name : "error-set-certificate-request-condition-should-not-timeout-if-pending" ,
580- sign : func (_ context.Context , cr signer.CertificateRequestObject , _ v1alpha1.Issuer ) ([] byte , error ) {
581- return nil , signer.SetCertificateRequestConditionError {
582+ sign : func (_ context.Context , cr signer.CertificateRequestObject , _ v1alpha1.Issuer ) (signer. PEMBundle , error ) {
583+ return signer. PEMBundle {} , signer.SetCertificateRequestConditionError {
582584 Err : signer.PendingError {Err : fmt .Errorf ("test error" )},
583585 ConditionType : "[condition type]" ,
584586 Status : cmmeta .ConditionTrue ,
@@ -623,8 +625,8 @@ func TestCertificateSigningRequestReconcilerReconcile(t *testing.T) {
623625 // exceeded).
624626 {
625627 name : "error-set-certificate-request-condition-should-not-retry-on-permanent-error" ,
626- sign : func (_ context.Context , cr signer.CertificateRequestObject , _ v1alpha1.Issuer ) ([] byte , error ) {
627- return nil , signer.SetCertificateRequestConditionError {
628+ sign : func (_ context.Context , cr signer.CertificateRequestObject , _ v1alpha1.Issuer ) (signer. PEMBundle , error ) {
629+ return signer. PEMBundle {} , signer.SetCertificateRequestConditionError {
628630 Err : signer.PermanentError {Err : fmt .Errorf ("test error" )},
629631 ConditionType : "[condition type]" ,
630632 Status : cmmeta .ConditionTrue ,
@@ -670,8 +672,8 @@ func TestCertificateSigningRequestReconcilerReconcile(t *testing.T) {
670672 // Set the Ready condition to Failed if the sign function returns a permanent error.
671673 {
672674 name : "fail-on-permanent-error" ,
673- sign : func (_ context.Context , cr signer.CertificateRequestObject , _ v1alpha1.Issuer ) ([] byte , error ) {
674- return nil , signer.PermanentError {Err : fmt .Errorf ("a specific error" )}
675+ sign : func (_ context.Context , cr signer.CertificateRequestObject , _ v1alpha1.Issuer ) (signer. PEMBundle , error ) {
676+ return signer. PEMBundle {} , signer.PermanentError {Err : fmt .Errorf ("a specific error" )}
675677 },
676678 objects : []client.Object {
677679 cmgen .CertificateSigningRequestFrom (cr1 ,
@@ -702,8 +704,8 @@ func TestCertificateSigningRequestReconcilerReconcile(t *testing.T) {
702704 // to retry.
703705 {
704706 name : "retry-on-error" ,
705- sign : func (_ context.Context , cr signer.CertificateRequestObject , _ v1alpha1.Issuer ) ([] byte , error ) {
706- return nil , errors .New ("waiting for approval" )
707+ sign : func (_ context.Context , cr signer.CertificateRequestObject , _ v1alpha1.Issuer ) (signer. PEMBundle , error ) {
708+ return signer. PEMBundle {} , errors .New ("waiting for approval" )
707709 },
708710 objects : []client.Object {
709711 cmgen .CertificateSigningRequestFrom (cr1 ,
0 commit comments