Commit Graph

16 Commits

Author SHA1 Message Date
Richard Wall
6c544dafa0 Simplify the return statement
pkg/controller/certificates/trigger/trigger_controller_test.go:257:12: if block ends with a return statement, so drop this else and outdent its block

Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2021-05-04 14:57:20 +01:00
Maël Valais
27f258cf3c trigger-controller: PR comment: use a single "fixedClock"
Signed-off-by: Maël Valais <mael@vls.dev>
Co-authored-by: Irbe Krumina <irbekrm@gmail.com>
2021-04-06 18:09:28 +02:00
Maël Valais
05c1fb9fc2 trigger-controller: reissue on mismatch using NextRevisionRequest
Signed-off-by: Maël Valais <mael@vls.dev>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2021-04-06 18:09:28 +02:00
Maël Valais
9305766ff2 trigger-controller: add two unit tests to showcase #3250
Note that I had initially made createCryptoBundle public since I found
it inconvenient to have to pass a testing.T when we know that we should
never be  failing inside this func (I mean, the failure  zould not be due
to a wrong test case).

After a comment from Maartje, I realize that I could just use an anonymous
function for that purpose.

Signed-off-by: Maël Valais <mael@vls.dev>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2021-04-06 18:09:27 +02:00
Maël Valais
fe3617a41c PR comment: a sentence starts with a capital letter and ends with a dot
Signed-off-by: Maël Valais <mael@vls.dev>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2021-03-24 19:19:34 +01:00
Maël Valais
71e707387a trigger-controller: refactor test, inject gatherer and policychain
Injecting the whole Gatherer struct was not necessary for testing
since DataForCertificate is now fully unit-tested. With that, we
can mock the Gatherer.Evaluate function. Since there is no reason
to inject a full Gatherer object into the trigger controller, I chose
to inject a simple policies.Func. I named the function "shouldReissue"
since this is exactly what this function does.

I also refactored the test cases to use the same gen.Certificate
that we use in the rest of the codebase.

Signed-off-by: Maël Valais <mael@vls.dev>
2021-03-23 13:55:11 +01:00
joshvanl
39a50a1903 Updates unit certificate controller tests to include ObservedGeneration
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-03-04 17:04:09 +00:00
jetstack-bot
cdc53b65cb
Merge pull request #3500 from meyskens/update-copy
Update copyright to cert-manager project
2020-12-15 10:12:31 +00:00
Maartje Eyskens
ab0cd57dc5 Use The cert-manager Authors.
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-12-11 19:04:13 +01:00
Maartje Eyskens
1788a9d758 Update copyright to cert-manager project
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-12-08 19:04:49 +01:00
Maël Valais
07fd8754f5 refactor(trigger): add test case when failure just happened
Signed-off-by: Maël Valais <mael.valais@gmail.com>
2020-12-06 13:51:12 +01:00
Maël Valais
769303c5f8 refactor(trigger): don't backoff when exactly 60min
As Maartje mentioned, it doesn't make sense to return backoff = true
while returning a delay of 0. Also, use time.UTC instead of time.Local.

Signed-off-by: Maël Valais <mael.valais@gmail.com>
2020-12-06 13:44:06 +01:00
Maël Valais
27d4924b5a refactor(trigger): move backoff logic to a unit-tested func
The trigger_controller_test.go has many unrelated test cases and I
thought it would be good to have more tightly scoped functions that are
easy to review (and most importantly, the unit tests are easy to
review).

Signed-off-by: Maël Valais <mael.valais@gmail.com>
2020-12-06 13:40:01 +01:00
Richard Wall
a70298180a Run a script to update v1alpha2 usage to v1
Script is available at https://github.com/jetstack/cert-manager/pull/3201

Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-08-20 14:26:51 +01:00
James Munnelly
fdc0960d27 Schedule a 'resync' of Certificates that have been marked as failed and are to be retried later
Signed-off-by: James Munnelly <james@munnelly.eu>
2020-07-20 09:19:11 +01:00
James Munnelly
9e2d6a514b Move expcertificates into certificates package
Signed-off-by: James Munnelly <james@munnelly.eu>
2020-07-01 12:16:25 +01:00