From 85128f26ce93539b832315e7ed9f977f2634f7df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Valais?= Date: Thu, 1 Apr 2021 10:18:44 +0200 Subject: [PATCH] trigger-controller: PR comment: rephrase log about skipping issuance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The log message: multiple CertificateRequests found for the 'next' revision 2, skipping issuance until no more duplicate. can be better phrased as: multiple CertificateRequests are found for the 'next' revision 2, issuance is skipped until there are no more duplicates. Signed-off-by: Maƫl Valais Co-authored-by: Josh Soref --- .../certificates/trigger/policies/gatherer_test.go | 2 +- .../certificates/trigger/trigger_controller.go | 10 +++++----- test/e2e/suite/issuers/acme/certificate/http01.go | 2 +- test/unit/gen/certificate.go | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/controller/certificates/trigger/policies/gatherer_test.go b/pkg/controller/certificates/trigger/policies/gatherer_test.go index a6c1bbc9c..d3a2d6c2c 100644 --- a/pkg/controller/certificates/trigger/policies/gatherer_test.go +++ b/pkg/controller/certificates/trigger/policies/gatherer_test.go @@ -56,7 +56,7 @@ func TestDataForCertificate(t *testing.T) { builder: &testpkg.Builder{}, wantSecret: nil, }, - "when no current or next CR exists, the returned cur and next CRs are nil": { + "when neither current nor next CRs exist, the returned cur and next CRs should be nil": { givenCert: gen.Certificate("cert-1", gen.SetCertificateNamespace("default-unit-test-ns"), gen.SetCertificateSecretName("secret-1"), gen.SetCertificateUID("uid-1"), diff --git a/pkg/controller/certificates/trigger/trigger_controller.go b/pkg/controller/certificates/trigger/trigger_controller.go index 25fddcb47..486a4fcb5 100644 --- a/pkg/controller/certificates/trigger/trigger_controller.go +++ b/pkg/controller/certificates/trigger/trigger_controller.go @@ -199,12 +199,12 @@ func (c *controller) ProcessItem(ctx context.Context, key string) error { return nil } -// shouldBackoffReissuingOnFailure tells us if this certificate's -// re-issuance should be backed off and for how much time. +// shouldBackoffReissuingOnFailure tells us if we should back off +// re-issuing for this certificate and for how much time. // -// The request can be left nil, in which case no back off is required. When -// the certificate doesn't match the request, no back off is required -// either since it means the request will have to be re-issued. +// The request can be left nil, in which case no back off is required. +// Additionally, if the certificate doesn't match the request, no back +// off is required because it means the request will have to be re-issued. func shouldBackoffReissuingOnFailure(log logr.Logger, c clock.Clock, crt *cmapi.Certificate, nextCR *cmapi.CertificateRequest) (backoff bool, delay time.Duration) { if crt.Status.LastFailureTime == nil { return false, 0 diff --git a/test/e2e/suite/issuers/acme/certificate/http01.go b/test/e2e/suite/issuers/acme/certificate/http01.go index 0430dab5b..7f4da64f8 100644 --- a/test/e2e/suite/issuers/acme/certificate/http01.go +++ b/test/e2e/suite/issuers/acme/certificate/http01.go @@ -279,7 +279,7 @@ var _ = framework.CertManagerDescribe("ACME Certificate (HTTP01)", func() { Expect(err).NotTo(HaveOccurred()) }) - It("should allow updating the dns name of a failing certificate that had a wrong dns name", func() { + It("should allow updating the dns name of a failing certificate that had an incorrect dns name", func() { certClient := f.CertManagerClientSet.CertmanagerV1().Certificates(f.Namespace.Name) By("Creating a failing Certificate") diff --git a/test/unit/gen/certificate.go b/test/unit/gen/certificate.go index 8a3545536..9a69abab4 100644 --- a/test/unit/gen/certificate.go +++ b/test/unit/gen/certificate.go @@ -231,7 +231,7 @@ func AddCertificateLabels(labels map[string]string) CertificateModifier { // give the full certificate. Only use this function for testing purposes. // // Note that the only "important" field that must be filled in ownerReference -// [1] is the UID. Must notably, the IsControlledBy function [2] only cares +// [1] is the UID. Most notably, the IsControlledBy function [2] only cares // about the UID. The apiVersion, kind and name are only used for information // purposes. //