-
Notifications
You must be signed in to change notification settings - Fork 781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use lifespan instead of duration for calculating when cert should be rotate #1865
use lifespan instead of duration for calculating when cert should be rotate #1865
Conversation
Hi @kevinschoonover , this looks great so far! It would be really nice to have a Unit Test to verify that the correct sleep duration is calculated. Maybe we can create a test in |
Hi @divyaac! Thanks for taking a look. I went ahead and added a unit test in |
Hey @kevinschoonover ! I've been following this with @divyaac and it looks like the |
Also, I wanted to apologize for the delay on getting this reviewed. I know that months is a long time, and this one slipped through the cracks a little bit. This looks good to us though and we'd love to work with you to get this merged. Thank you for your patience and contributions! |
It seems like the issue here is with the new behavior of
I added a commit which will fix the flakiness by always waiting 93% of the lifetime, but not sure if it keeps the fidelity of the test.
Thanks for looking at it! No worries, I have a different PR in vault that has been waiting for 1.5 years so I have developed all the patience I need 😉 |
closes #1612
The current logic for determining how long a certificate rotates depends on the duration (
time the certificate expires
-the current time
) which seems to have weird corner cases that cause the certificate to be renewed at much later than 86-93% of the ttl which was originally intended. This updates the code to determine arotationTime
(i.e. the time that is NotBefore + 86-93% of the lifespan of the certificate) and sleeps until therotationTime
occurs.Once this is merged, I can follow with a fix for #1646