@@ -451,8 +451,8 @@ func TestCertificateNotReadyWithBubbledUpMessage(t *testing.T) {
451451 Conditions : duckv1.Conditions {
452452 {
453453 Type : "Ready" ,
454- Status : "False " ,
455- Reason : "CommonName Too Long " ,
454+ Status : "Unknown " ,
455+ Reason : "The ready condition of Cert Manager Certificate does not exist. " ,
456456 },
457457 },
458458 },
@@ -463,7 +463,7 @@ func TestCertificateNotReadyWithBubbledUpMessage(t *testing.T) {
463463 r .InitializeConditions ()
464464 r .MarkCertificateNotReady (cert )
465465
466- expectedCertMessage := "CommonName Too Long "
466+ expectedCertMessage := "The ready condition of Cert Manager Certificate does not exist. "
467467 certMessage := r .Status .GetCondition ("Ready" ).Message
468468 if ! strings .Contains (certMessage , expectedCertMessage ) {
469469 t .Errorf ("Literal %q not found in status message: %q" , expectedCertMessage , certMessage )
@@ -473,11 +473,37 @@ func TestCertificateNotReadyWithBubbledUpMessage(t *testing.T) {
473473func TestCertificateProvisionFailed (t * testing.T ) {
474474 r := & RouteStatus {}
475475 r .InitializeConditions ()
476- r .MarkCertificateProvisionFailed ("cert" )
476+ r .MarkCertificateProvisionFailed (& netv1alpha1. Certificate {} )
477477
478478 apistest .CheckConditionFailed (r , RouteConditionCertificateProvisioned , t )
479479}
480480
481+ func TestCertificateFailedWithBubbledUpMessage (t * testing.T ) {
482+ cert := & netv1alpha1.Certificate {
483+ Status : netv1alpha1.CertificateStatus {
484+ Status : duckv1.Status {
485+ Conditions : duckv1.Conditions {
486+ {
487+ Type : "Ready" ,
488+ Status : "False" ,
489+ Reason : "CommonName Too Long" ,
490+ },
491+ },
492+ },
493+ },
494+ }
495+
496+ r := & RouteStatus {}
497+ r .InitializeConditions ()
498+ r .MarkCertificateProvisionFailed (cert )
499+
500+ expectedCertMessage := "CommonName Too Long"
501+ certMessage := r .Status .GetCondition ("Ready" ).Message
502+ if ! strings .Contains (certMessage , expectedCertMessage ) {
503+ t .Errorf ("Literal %q not found in status message: %q" , expectedCertMessage , certMessage )
504+ }
505+ }
506+
481507func TestRouteNotOwnCertificate (t * testing.T ) {
482508 r := & RouteStatus {}
483509 r .InitializeConditions ()
0 commit comments