mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
fix cert rotation function
This commit is contained in:
parent
f8ec6f905a
commit
436ff4ef63
@ -796,11 +796,5 @@ func expired(certFile string) bool {
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
expirationDate := certificates[0].NotAfter
|
||||
diffDays := expirationDate.Sub(time.Now()).Hours() / 24.0
|
||||
if diffDays <= 90 {
|
||||
logrus.Infof("certificate %s is about to expire", certFile)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
return certutil.IsCertExpired(certificates[0])
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user