Configurable issuer duration and renewBefore Take 2#893
Configurable issuer duration and renewBefore Take 2#893jetstack-bot merged 66 commits intocert-manager:masterfrom
Conversation
|
/hold This is just to get the ball roling and get some early feedback, e2e tests had a lot of changes since the original commit and need to be reworked. Docs are not updated yet and validation still needs to be written. |
pkg/issuer/issuer.go
Outdated
|
|
||
| const ( | ||
| // Error reason generated when duration or renewBefore is invalid | ||
| ErrorDurationInvalid = "ErrDurationInvalid" |
There was a problem hiding this comment.
A lot of things to do with constants seemed to move since the original commit, so I stuck this here, Is there a better place for it?
There was a problem hiding this comment.
From what I can tell, this var isn't actually used? Unless GitHub is collapsing things in the diff for me! 😄
There was a problem hiding this comment.
Yup you're right, this is a holdover from when we were triggering events for stuff (I think) so I'll remove it
| ) | ||
|
|
||
| // to help testing | ||
| var now = time.Now |
There was a problem hiding this comment.
I kind of hate this line, and I don't understand it's purpose in the original commit. I know that it is used in the test (next file down), but there must be a better way to handle it.
|
/ok-to-test |
fc65bce to
7a873bf
Compare
7a873bf to
a3aa97d
Compare
|
@munnerz Can you tell me what version of dep the CI server uses? I dont think the new Bazel system prints it out like the old hack script used to and for a while now I get the following error when I run |
|
OK well nvm it looks like it really did just need the |
This is down to that one bitbucket dependency afaict. We've had this issue for a while, and it's really annoying! 😬 Glad you got it resolved. FWIW, I think you need to run: 😄 |
|
I also DM'd you on slack just now - feel free to reach out directly if you run into more issues. The new Bazel build system is still early on and there could be a few rough edges! |
|
|
||
| // Default duration before certificate expiration if Issuer.spec.renewBefore is not set | ||
| DefaultRenewBefore = time.Hour * 24 * 30 | ||
| ) |
There was a problem hiding this comment.
Is this the best place for these constants to go?
There was a problem hiding this comment.
👍 I think so - this ultimately does become part of our public API, and given we are still alpha, it does not preclude a breaking change if needs be 😄
|
@munnerz Couple of things that I was thinking about that I'd like your opinion on
I think both of these are probably future work in the space of defaulting policies and certificate delivery that you had mentioned in previous discussions. |
|
/hold cancel This passed a few tests I ran in a real cluster this morning, issued certs correctly have expirations set, etc. and I was able to issue such a client cert to someone who needs short term access to my cluster. So I think this is at your mercy @munnerz |
Signed-off-by: Max Ehrlich <max.ehr@gmail.com>
bbb1f33 to
9706517
Compare
Signed-off-by: Max Ehrlich <max.ehr@gmail.com>
Signed-off-by: Max Ehrlich <max.ehr@gmail.com>
b3865a4 to
6ff6ce6
Compare
|
@munnerz Ok well, it seems to pass e2e tests now, but I'm not exactly happy with the solution which was to just not set the |
…be caught as any other too-small value Signed-off-by: Max Ehrlich <max.ehr@gmail.com>
Signed-off-by: Max Ehrlich <max.ehr@gmail.com>
|
/hold cleaning up some of the e2e tests |
…te API calls Signed-off-by: Max Ehrlich <max.ehr@gmail.com>
Signed-off-by: Max Ehrlich <max.ehr@gmail.com>
Signed-off-by: Max Ehrlich <max.ehr@gmail.com>
|
/hold cancel I think it's done now |
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
b641468 to
3a32527
Compare
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
|
I added a few commits on top to clean up a few things, to save you having to go through more rounds of review and back-and-forth!
I also removed some dead/irrelevant code that I think has been brought forward from rebases. Thanks for being so persistent with this, I know it's been a pain! /lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: munnerz The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Truly a momentous occasion That's pretty much all I've got for the foreseeable future, good luck with the project Btw how long until this is available in an image? |
This is me commandeering #520 because it is clearly not being worked on
Plan right now is to skip 516be06 in favor of validation which disallows duration for ACME issuers.
What this PR does / why we need it:
This pull request makes possible to configure the certificate validity duration and the renewal before duration per issuer.
Which issue this PR fixes
#437
Special notes for your reviewer:
TODO
Salvage code from 7230151Make the existing unit and e2e tests workUse duration config in self-signed issuerGeneral code quality updatesValidate that duration is not set for ACME certs (w/ unit test)Test everything in a real clusterValidate durations in validation and not issuer setupRelease note: