Skip to content

Commit

Permalink
Merge pull request #25 from seandilda/fix_default_renew_period
Browse files Browse the repository at this point in the history
Fix default renewal period
  • Loading branch information
jetstack-bot authored Oct 5, 2023
2 parents 0f81ec9 + b24dd59 commit 48b0109
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/controller/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ func (r *Route) hasValidCertificate(route *routev1.Route) bool {
)
}
}
// As there is no renew-before, is the cert less than 2/3 through its life?
// As there is no renew-before, is the cert more than 2/3 through its life?
totalDuration := cert.NotAfter.Sub(cert.NotBefore)
timeToExpiry := cert.NotAfter.Sub(time.Now())
if timeToExpiry < (totalDuration * 2 / 3) {
if timeToExpiry < (totalDuration * 1 / 3) {
r.eventRecorder.Event(route, corev1.EventTypeNormal, ReasonIssuing, "Issuing cert as the existing cert is more than 2/3 through its validity period")
return false
}
Expand Down

0 comments on commit 48b0109

Please sign in to comment.