From 8a07ee505fd33deb07668883c9d4e05b077840d1 Mon Sep 17 00:00:00 2001 From: Tim Ramlot <42113979+inteon@users.noreply.github.com> Date: Sun, 12 Nov 2023 17:14:16 +0100 Subject: [PATCH] fix tests Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com> --- .../certificaterequest_controller_test.go | 28 +++++++++---------- ...rtificatesigningrequest_controller_test.go | 4 +-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/controllers/certificaterequest_controller_test.go b/controllers/certificaterequest_controller_test.go index ef9c220..c1d0fe7 100644 --- a/controllers/certificaterequest_controller_test.go +++ b/controllers/certificaterequest_controller_test.go @@ -451,14 +451,14 @@ func TestCertificateRequestReconcilerReconcile(t *testing.T) { Type: cmapi.CertificateRequestConditionReady, Status: cmmeta.ConditionFalse, Reason: cmapi.CertificateRequestReasonPending, - Message: "Signing of CertificateRequest still in progress: reason for being pending", + Message: "Signing still in progress. Reason: Signing still in progress. Reason: reason for being pending", LastTransitionTime: &fakeTimeObj2, }, }, }, validateError: errormatch.ErrorContains("reason for being pending"), expectedEvents: []string{ - "Warning Pending Signing of CertificateRequest still in progress: reason for being pending", + "Warning RetryableError Signing still in progress. Reason: Signing still in progress. Reason: reason for being pending", }, }, @@ -496,21 +496,21 @@ func TestCertificateRequestReconcilerReconcile(t *testing.T) { Type: "[condition type]", Status: cmmeta.ConditionTrue, Reason: "[reason]", - Message: "condition message", + Message: "test error", LastTransitionTime: &fakeTimeObj2, }, { Type: cmapi.CertificateRequestConditionReady, Status: cmmeta.ConditionFalse, Reason: cmapi.CertificateRequestReasonPending, - Message: "Signing of CertificateRequest still in progress: reason why it is still in progress", + Message: "Failed to sign CertificateRequest, will retry: test error", LastTransitionTime: &fakeTimeObj2, }, }, }, validateError: errormatch.ErrorContains("terminal error: test error"), expectedEvents: []string{ - "Warning Pending Signing of CertificateRequest still in progress: test error", + "Warning RetryableError Failed to sign CertificateRequest, will retry: test error", }, }, @@ -562,14 +562,14 @@ func TestCertificateRequestReconcilerReconcile(t *testing.T) { Type: cmapi.CertificateRequestConditionReady, Status: cmmeta.ConditionFalse, Reason: cmapi.CertificateRequestReasonPending, - Message: "Signing of CertificateRequest still in progress: reason for being pending", + Message: "Failed to sign CertificateRequest, will retry: test error2", LastTransitionTime: &fakeTimeObj2, }, }, }, - validateError: errormatch.ErrorContains("reason for being pending"), + validateError: errormatch.ErrorContains("test error2"), expectedEvents: []string{ - "Warning Pending Signing of CertificateRequest still in progress: reason for being pending", + "Warning RetryableError Failed to sign CertificateRequest, will retry: test error2", }, }, @@ -719,21 +719,21 @@ func TestCertificateRequestReconcilerReconcile(t *testing.T) { Type: "[condition type]", Status: cmmeta.ConditionTrue, Reason: "[reason]", - Message: "reason for being still pending", + Message: "test error", LastTransitionTime: &fakeTimeObj2, }, { Type: cmapi.CertificateRequestConditionReady, Status: cmmeta.ConditionFalse, Reason: cmapi.CertificateRequestReasonPending, - Message: "Signing of CertificateRequest still in progress: reason for being still pending", + Message: "Signing still in progress. Reason: Signing still in progress. Reason: test error", LastTransitionTime: &fakeTimeObj2, }, }, }, - validateError: errormatch.ErrorContains("terminal error: reason for being still pending"), + validateError: errormatch.ErrorContains("terminal error: test error"), expectedEvents: []string{ - "Warning Pending Signing of CertificateRequest still in progress: reason for being still pending", + "Warning RetryableError Signing still in progress. Reason: Signing still in progress. Reason: test error", }, }, @@ -844,14 +844,14 @@ func TestCertificateRequestReconcilerReconcile(t *testing.T) { Type: cmapi.CertificateRequestConditionReady, Status: cmmeta.ConditionFalse, Reason: cmapi.CertificateRequestReasonPending, - Message: "Signing of CertificateRequest still in progress: waiting for approval", + Message: "Failed to sign CertificateRequest, will retry: waiting for approval", LastTransitionTime: &fakeTimeObj2, }, }, }, validateError: errormatch.ErrorContains("waiting for approval"), expectedEvents: []string{ - "Warning Pending Signing of CertificateRequest still in progress: waiting for approval", + "Warning RetryableError Failed to sign CertificateRequest, will retry: waiting for approval", }, }, diff --git a/controllers/certificatesigningrequest_controller_test.go b/controllers/certificatesigningrequest_controller_test.go index 1158ab8..182ec52 100644 --- a/controllers/certificatesigningrequest_controller_test.go +++ b/controllers/certificatesigningrequest_controller_test.go @@ -344,7 +344,7 @@ func TestCertificateSigningRequestReconcilerReconcile(t *testing.T) { }, validateError: errormatch.ErrorContains("pending error"), expectedEvents: []string{ - "Warning RetryableError Failed to sign CertificateSigningRequest, will retry: pending error", + "Warning Pending Signing still in progress. Reason: Signing still in progress. Reason: pending error", }, }, @@ -600,7 +600,7 @@ func TestCertificateSigningRequestReconcilerReconcile(t *testing.T) { }, validateError: errormatch.ErrorContains("terminal error: test error"), expectedEvents: []string{ - "Warning RetryableError Failed to sign CertificateSigningRequest, will retry: test error", + "Warning Pending Signing still in progress. Reason: Signing still in progress. Reason: test error", }, },