Commit Graph

50 Commits

Author SHA1 Message Date
Tim Ramlot
085136068a
fix misspell linter
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2024-04-29 15:21:07 +02:00
Tim Ramlot
15bc387da6
make changes based on feedback
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-10-13 19:42:13 +02:00
Tim Ramlot
d40dae9d67
Fix DuplicateSecretName issue
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-10-11 13:47:44 +02:00
irbekrm
7d592a8270 Swap upstream core informers factory with out wrapper
This does not actually change how the informers work. This also adds a partial metadata client to root context

Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-03-22 09:03:16 +00:00
irbekrm
5d7614ddd4 Passes controller context into all NewController funcs
Instead of individual arguments. For readability and consistency.

Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-03-22 09:03:16 +00:00
Tim Ramlot
23de5240e9
move utility functions to reduce fragmentation and rename functions for consistency
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-01-23 13:19:39 +01:00
irbekrm
dbad3d98f3 Rename issuanceAttempts -> failedIssuanceAttempts
In an attempt to convey the meaning of the field better

Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-03-21 07:33:51 +00:00
irbekrm
4c901aefab Code review comments
Adds test conditions to certs via patch API call instead of update to avoid conflicts

Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-03-21 07:33:51 +00:00
irbekrm
739c3298e8 Trigger controller backs off from issuance with an exponential backoff
Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-03-21 07:33:51 +00:00
joshvanl
4dc6c957d4 Adds review comments
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-02-11 16:15:57 +00:00
joshvanl
37775615ff Use ApplyStatus in all Certificates controllers. When ServerSideApply
enabled, set Issuing condition to False instead of removing it

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-02-11 16:15:57 +00:00
joshvanl
bdb4954c25 Adds updateOrApply to certificates controllers to optionally Apply
certificate based on feature gate

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-02-11 16:14:31 +00:00
Ashley Davis
3a055cc2f5
rename all uses of github.com/jetstack/cert-manager
This was done by running the following command twice:

 ```bash
 grep -Ri "github.com/jetstack/cert-manager" . | \
 cut -d":" -f1 | \
 sort | \
 uniq | \
 xargs sed -i
 "s/github.com\/jetstack\/cert-manager/github.com\/cert-manager\/cert-manager/"
 ```

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-02-02 09:08:31 +00:00
joshvanl
c66591cf37 Update certificate controllers with new controller builder
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-01-27 12:51:48 +00:00
joshvanl
38b7b930c8 Add tests from rebase and more policies under
/internal/controller/certificates

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-01-19 14:31:05 +00:00
joshvanl
a53987214f Move certificates controller policies under /internal/controller
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-01-19 14:30:00 +00:00
joshvanl
f1cafae95f Refactor trigger policies to be more generic and be used by multiple
controllers

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-01-19 14:30:00 +00:00
joshvanl
d5503c2ed2 Change certificates controller to no longer error for a Certificate that
no longer exists

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-11-30 15:13:14 +00:00
Maël Valais
e4f981da66 Revert "memory leak: clean up scheduler goroutine on cert deletion"
This reverts commit 641960b6. The reason we decided to revert this is
that we are unsure about the implications of adding the
scheduledWorkQueue.Forget call. The new Forget call is left untested,
and it makes us nervous not to know exactly if it works as intended.

The "Forget" memory leak that we are reverting now is the cause of a
tiny fraction of the overall memory leakage that was fixed in the PR
in the scheduler itself.  Reverting this means that some goroutines will
be leaked, but only when a Certificate gets removed and never recreated
with the same name.

Signed-off-by: Maël Valais <mael@vls.dev>
2021-07-28 19:19:39 +02:00
Maël Valais
641960b666 memory leak: clean up scheduler goroutine on certificate deletion
Signed-off-by: Maël Valais <mael@vls.dev>
2021-07-23 16:57:10 +02:00
irbekrm
feb62b1fe5 Make the back off period const public
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-06-22 06:37:07 +01:00
irbekrm
e6b748047d Remove the default renewBefore value
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-06-11 10:03:12 +01:00
Maël Valais
8f5a094b0c trigger-controller: PR comment: failure mode -> failure state
Cf. https://github.com/jetstack/cert-manager/pull/3444#pullrequestreview-629189131

Signed-off-by: Maël Valais <mael@vls.dev>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2021-04-06 19:14:49 +02:00
Maël Valais
6c9477439c trigger-controller: hint people to look at gatherer.go diagrams
Signed-off-by: Maël Valais <mael@vls.dev>
2021-04-06 18:09:59 +02:00
Maël Valais
450d27f5d0 trigger-controller: PR comment: and -> if there is
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
c1bf35f4ed trigger-controller: further comments on shouldBackoffReissuingOnFailure
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
36c2cc4d3b trigger-controller: PR comment: explain what "if nextCR != nil" is about
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
85128f26ce trigger-controller: PR comment: rephrase log about skipping issuance
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 <mael@vls.dev>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.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
jetstack-bot
7946df1da7
Merge pull request #3788 from maelvls/refactor-trigger-unit-tests
Refactor trigger-controller unit tests
2021-03-25 11:41:36 +00:00
Maël Valais
7e21f730cc PR comment: typo: "the following are" instead of "is"
Signed-off-by: Maël Valais <mael@vls.dev>
Co-authored-by: Jake Sanders <i@am.so-aweso.me>
2021-03-25 09:07:45 +01:00
joshvanl
dd0b2bf510 Standardise the name of controllers so there is consistency across the
project

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-03-23 16:08:59 +00: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
Maël Valais
cdb6c16c6d trigger-controller: log a msg when cert must be reissued
Signed-off-by: Maël Valais <mael@vls.dev>
2021-03-21 16:45:58 +01:00
irbekrm
245d0f5c27 Pass DefaultRenewBefore into trigger controller
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-03-15 08:48:02 +00:00
irbekrm
8d5059b13e Updates Trigger controller integration tests
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-03-15 08:47:42 +00: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
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
Maartje Eyskens
3259fdfe9b Implement feedback
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-12 10:59:42 +02:00
Maartje Eyskens
827ce9c5ad Revert log levels on errors
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-12 10:59:42 +02:00
Maartje Eyskens
86dee5ed41 Set error log levels
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-12 10:59:41 +02:00
Maartje Eyskens
fecd0b3518 Set all log levels for info
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-12 10:59:41 +02: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
Haoxiang Zhou
fe80b7d760 Moved predicate package to pkg/util
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-07-02 12:23:15 +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