Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Ramlot <[email protected]>
  • Loading branch information
inteon committed Nov 12, 2023
1 parent a540ab7 commit 8a07ee5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
28 changes: 14 additions & 14 deletions controllers/certificaterequest_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
},

Expand Down Expand Up @@ -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",
},
},

Expand Down Expand Up @@ -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",
},
},

Expand Down Expand Up @@ -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",
},
},

Expand Down Expand Up @@ -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",
},
},

Expand Down
4 changes: 2 additions & 2 deletions controllers/certificatesigningrequest_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
},

Expand Down Expand Up @@ -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",
},
},

Expand Down

0 comments on commit 8a07ee5

Please sign in to comment.