Commit Graph

153 Commits

Author SHA1 Message Date
irbekrm
e7cc37ef71 Code review feedback
Signed-off-by: irbekrm <irbekrm@gmail.com>

Co-authored-by: Maël Valais <mael@vls.dev>
2022-01-11 18:09:44 +00:00
irbekrm
24866544b8 Ensures that if alternate cert chain is specified, it is retrieved
Ensures that if the cert is retrieved in a reconcile following the one that finalized the ACME order, the alternate cert chain is still respected, if specified by user

Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-01-11 10:51:14 +00:00
irbekrm
de8aa2583e Ensures that ACME orders controller does not create new order if it failed to update old order's status to valid
Check the status of the ACME order if finalizing order failed to catch edge cases where the order is already finalized, but the updating of Order CR's status has failed

Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-01-11 10:51:14 +00:00
irbekrm
e48846132b Add a couple new test cases for order finalization
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-11-26 16:32:02 +00:00
irbekrm
4aee0a4acd Reduce a few calls to ACME server
Ensure that when updating cert-manager Order CR's status from an existing ACME Order only one call will be made to retrieve the ACME Order

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-11-26 16:31:27 +00:00
irbekrm
e66c6a04d4 Fixes a typo in finalizeOrders
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-11-26 16:30:25 +00:00
irbekrm
7739497f22 Don't process Order CRs that have failed
Ensure that cert-manager does not attempt to create new ACME Orders for cert-manager Order CRs that are in failed (errored, invalid or expired) state. If the CertificateRequest was created from a Certificate, the issuance will be retried after 1 hour

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-11-23 15:34:35 +00:00
irbekrm
598ed35e4a Uses go/crypto ListCertAlternates function to fetch alternative certificate chains
This allows us to use upstream go/crypto again instead of our own fork

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-10-07 15:21:26 +01: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
Ashley Davis
c67c2c4f47
static analysis: pkg/controller
fixes the following issues:

pkg/controller/acmeorders/util.go:84:6 deadcode `hashChallenge` is unused
pkg/controller/certificaterequests/approver/approver.go:72:14 staticcheck SA4021: x = append(y) is equivalent to x = y
pkg/controller/certificaterequests/vault/vault_test.go:535:21 errcheck Error return value of `controller.Register` is not checked
pkg/controller/certificates/trigger/policies/policies.go:121:26 gosimple S1039: unnecessary use of fmt.Sprintf
pkg/controller/clusterissuers/sync_test.go:55:12 errcheck Error return value of `c.Register` is not checked
pkg/controller/ingress-shim/sync.go:301:2 gosimple S1005: unnecessary assignment to the blank identifier

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2021-05-21 12:03:47 +01:00
irbekrm
06f6b46f30 Implements feedback from code review
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-05-19 13:20:05 +01:00
irbekrm
bbfd2294f9 Integration test for ACME Orders controller
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-05-19 13:11:48 +01:00
irbekrm
d8c941da8e Refactors creation of ACME Orders controller
So that it easier used with the existing test framework and also is more similar to how most other controllers are created

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-05-19 13:11:18 +01:00
irbekrm
8d55b69796 Unit test pending ACME order with valid challenges
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-05-19 13:06:12 +01:00
irbekrm
1e235c79f2 Re-queue Order with finalized Challenges, but pending state
To avoid stuck Orders in case of a misbehaving ACME server

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-05-19 13:05:44 +01:00
irbekrm
a42771b7e4 Adds a bunch of comments for exported types
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-05-19 10:19:43 +01:00
irbekrm
881fb2ddea Make tests fail if controller registration fail
Part of work towards fixing errors discovered by static analysis tools

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-05-19 10:16:59 +01:00
Jake Sanders
f194d9b732
Add godoc comments
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2021-05-05 15:59:02 +01:00
Jake Sanders
62aa7aa33e
staticcheck: error strings should not be capitalized (ST1005)
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2021-05-04 14:54:05 +01:00
jetstack-bot
06b68d35e0
Merge pull request #3835 from RinkiyaKeDad/3620_constants_in_eventf
chore: used constants for string literals when recording new events
2021-04-13 15:14:11 +01:00
RinkiyaKeDad
0b87eeae97 added reason prefix for all
Signed-off-by: RinkiyaKeDad <arshsharma461@gmail.com>
2021-04-13 16:40:56 +05:30
RinkiyaKeDad
bba7c1011d added prefix and made constants public
Signed-off-by: RinkiyaKeDad <arshsharma461@gmail.com>
2021-04-08 12:17:15 +05:30
RinkiyaKeDad
ab912ef120 chore: added constants for non repeating ones also
Signed-off-by: RinkiyaKeDad <arshsharma461@gmail.com>
2021-04-01 15:46:54 +05:30
joshvanl
18ae2295f9 Pass context through to client calls in controllers and acme issuer
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-03-31 20:34:12 +01:00
Salman
572bfb9111 Replace reflect.DeepEqual with semantic equality check
Signed-off-by: salmanahmed404 <salmanahmed404@gmail.com>
2021-03-27 12:49:14 +05:30
Josh Soref
4d84a7fbb1 spelling: preferred
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2021-03-04 13:04:38 -05:00
Josh Soref
d5eca4e4e3 spelling: normalize
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2021-03-04 13:04:38 -05: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
Maartje Eyskens
04d88479e4 Pass duration on until ACME order creation
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-11-20 09:46:49 +01:00
Maartje Eyskens
7b6573aa35 Add duration into ACME
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-11-20 09:45:32 +01:00
Mateusz Gozdek
27fa2f1ec4
Fix various typos found by codespell
Found by running this command:

codespell -S .git,*.png,go.sum -L keypair,iam,ans,unknwon,tage,ths,creater

Signed-off-by: Mateusz Gozdek <mgozdekof@gmail.com>
2020-11-07 14:55:13 +01:00
Maartje Eyskens
542b329914 Implement feedback
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-10-08 15:24:56 +02:00
Maartje Eyskens
9452327d1b Add test in order sync
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-10-08 15:24:56 +02:00
Maartje Eyskens
39de7f3b99 Fix IP type
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-10-08 15:24:56 +02:00
Maartje Eyskens
b3e25815a5 Add support for IPs in ACME
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-10-08 15:24:56 +02:00
Maartje Eyskens
c73c121ce1 Order imports
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-09-01 15:08:31 +02:00
Maartje Eyskens
f1c6c93df5 Fix CR and make a general function
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-28 15:06:54 +02:00
Maartje Eyskens
69186afbdd Move logic to utils
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-28 09:59:48 +02:00
Maartje Eyskens
bb89b50c8f Fix invalid DNS-1123 on ACME computed names
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-28 09:54:18 +02:00
Maartje Eyskens
824e075bf8 fmt
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-24 17:45:52 +02:00
Maartje Eyskens
75e31fe54c Add a unit test for alt chains
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-24 17:33:27 +02:00
Maartje Eyskens
90d6a54151 Add support for alternate certs with PrefferedChain in ACME
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-21 17:56:26 +02:00
Richard Wall
821d824cc2 Revert renaming of CSR > Request in comments and in error messages
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-08-20 14:28:07 +01:00
Richard Wall
758131ada2 Fix tests in github.com/jetstack/cert-manager/pkg/controller/acmeorders
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-08-20 14:28:06 +01:00
Richard Wall
81eb53f597 ./hack/update-all.sh
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-08-20 14:28:06 +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