mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-08-08 23:37:11 +00:00
Merge pull request #106225 from shawnhanx/certificates_cleaner
cleaner.go should use time.Until instead of t.Sub(time.Now())
This commit is contained in:
@@ -179,9 +179,9 @@ func isIssuedPastDeadline(logger klog.Logger, csr *capi.CertificateSigningReques
|
||||
return false
|
||||
}
|
||||
|
||||
// isOlderThan checks that t is a non-zero time after time.Now() + d.
|
||||
// isOlderThan checks that t is a non-zero and older than d from time.Now().
|
||||
func isOlderThan(t metav1.Time, d time.Duration) bool {
|
||||
return !t.IsZero() && t.Sub(time.Now()) < -1*d
|
||||
return !t.IsZero() && time.Since(t.Time) > d
|
||||
}
|
||||
|
||||
// isIssued checks if the CSR has `Issued` status. There is no explicit
|
||||
|
||||
Reference in New Issue
Block a user